gulp命令给出模块错误找不到 [英] gulp command giving errors of modules can not find
问题描述
我正在尝试在Windows上设置基本的aurelia应用.我遵循了以下指示: http://aurelia.io/get-started.html ,其中包括:
I am trying to set up the basic aurelia app on windows. I have followed instructions from: http://aurelia.io/get-started.html, which includes:
- 已安装的节点js
- 使用以下命令安装gulp:
npm install -g gulp
- 使用以下命令安装jspn:
npm install -g jspm
- 然后从 https://github.com/aurelia/skeleton-navigation下载了示例源代码./releases 到项目文件夹.
- 打开控制台并更改为项目目录,即.导航应用
- 执行命令:
npm install
- 执行了命令:
jspm install -y
- 最后使用以下命令启动服务器:
gulp watch
- Installed node js
- Installed the gulp using:
npm install -g gulp
- Installed jspn by using:
npm install -g jspm
- Then downloaded the sample source code from https://github.com/aurelia/skeleton-navigation/releases to the project folder.
- Opened a console and changed to project directory ie. navigation-app
- Executed the command :
npm install
- Executed the command:
jspm install -y
- Finally launched the server using command:
gulp watch
以上所有步骤均已成功完成,但步骤8出现错误:
All above steps are completed successfully except step 8, which is giving an error :
E:\aurelia\navigation-app>gulp watch
module.js:338
throw err;
^
Error: Cannot find module 'debug/node'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (E:\aurelia\navigation-app\node_modules\gulp-babel\nod
e_modules\babel-core\lib\babel\util.js:22:34)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
我不明白为什么它找不到模块.
如果我手动安装该模块,则在尝试运行时会给出另一个模块的错误消息:gulp watch
I am not getting why it can not find modules.
If I install that module manually it gives error message for another module when I try to run : gulp watch
推荐答案
自从将Aurelia和相关工具升级到最新版本以来,我一直在与这个问题作斗争.可能与Windows上带有本机Module.require的路径长度/深度问题有关.
I have also been battling this problem since upgrading Aurelia and related tools to the latest versions. It may be related to path length/depth issues on Windows with the native Module.require.
当我从项目的本地node_modules
文件夹中卸载以下软件包并将它们安装在全局NPM高速缓存(在我的情况下,其位于更浅的目录深度)中时,gulp build
再次开始工作:
When I uninstalled the following packages from the project's local node_modules
folder and instead installed them in the global NPM cache (which lives at a more shallow directory depth in my case), gulp build
started working again:
npm uninstall gulp-babel
npm uninstall browser-sync
npm uninstall karma
npm install -g gulp-babel
npm install -g browser-sync
npm install -g karma
这篇关于gulp命令给出模块错误找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!