找不到模块“glob" [英] Cannot find module 'glob'
问题描述
告诉我您需要什么额外信息
我遵循一个简单的指南来激活我的第一个 angular 2 应用程序并在 clr 上执行以下操作:
Im following a simple guide to activate my first angular 2 app and did the following actions on the clr:
npm i -g angular-cli //(worked)
ng new ponyracer //(error: Cannot find module 'glob')
ng serve //(error: Cannot find module 'glob')
Cannot find module 'glob'
Error: Cannot find module 'glob'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\stavalfi\AppData\Roaming\npm\node_modules\angular-cli\addon\ng2\tasks\lib-install.js:11:19)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
任何关于ng new ponyracer"和ng serve"命令的解释都会很棒.
Any explations about the commands "ng new ponyracer" and "ng serve" will be great.
谢谢,斯塔夫
推荐答案
已经有一个问题报告这个错误信息.下一个版本之前的解决方法是为项目安装 glob
(npm install --save glob
)
There's already an issue reporting this error message. The workaround until the next release is to install glob
for the project (npm install --save glob
)
关于命令,根据他们在 通过开发服务器生成和提供Angular2项目命令如下
Regarding the commands, according to their repository under Generating and serving an Angular2 project via a development server the commands are as follow
ng new ponyracer
:此命令将创建一个名为 ponyracer
的项目(一个名为 ponyracer 的文件夹,其中包含所有设置).
ng new ponyracer
: This command will create a project named ponyracer
(a folder named ponyracer with all the set up in it).
ng serve
:此命令将运行实时重载服务器来为应用程序提供服务您可以在浏览器中看到它.
ng serve
: This command will run the live reload server to serve the application so you can see it in your browser.
PS:如果您测试了问题中建议的解决方案,最好报告它是否有效.
PS : If you test the solution suggested in the issue it would be nice of you to report if it worked or not.
PS2:我现在进行了测试(我修正了我的错误),但我无法重现您的错误.我正在使用节点 v5.5.0 和 npm v3.7.3.你能指定你使用的是哪个 node 和 npm 版本吗?
PS2 : I tested now (I fixed my error) and I cannot reproduce your error. I'm using node v5.5.0 and npm v3.7.3. Can you specify which node and npm versions are you using?
这篇关于找不到模块“glob"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!