npm在项目中启动时出错

时间:2016-10-06 21:58:32

标签: angular ionic-framework npm

我正在尝试在安装npm模块后启动一个项目。

当我输入npm start时,我得到:

There is an error in your gulpfile: 
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    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)
    at Object.<anonymous> (/Users/tkhusid/WebstormProjects/Ionic-`enter code here`radar/ionic-radar/config/gulp/index.js:1:63)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

此外,此错误旁边还有其他错误:

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev:stub"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! techradar-ionic@0.2.0 dev:stub: `ionic serve --environment local`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the techradar-ionic@0.2.0 dev:stub script 'ionic serve --environment local'.
npm ERR! This is most likely a problem with the techradar-ionic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic serve --environment local
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs techradar-ionic
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls techradar-ionic
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tkhusid/WebstormProjects/Ionic-radar/ionic-radar/npm-debug.log

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! techradar-ionic@0.2.0 dev: `npm run dev:stub`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the techradar-ionic@0.2.0 dev script 'npm run dev:stub'.
npm ERR! This is most likely a problem with the techradar-ionic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run dev:stub
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs techradar-ionic
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls techradar-ionic
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tkhusid/WebstormProjects/Ionic-radar/ionic-radar/npm-debug.log

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! techradar-ionic@0.2.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the techradar-ionic@0.2.0 start script 'npm run dev'.
npm ERR! This is most likely a problem with the techradar-ionic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs techradar-ionic
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls techradar-ionic
npm ERR! There is likely additional logging output above.

我已经开始克隆项目了。 该项目已成功克隆。

非常感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

查看错误消息

  

在严格模式之外尚不支持块范围的声明(let,const,function,class)

似乎问题来自于代码是使用EcmaScript 6编写的,并且您使用的是还没有完全支持ES6的nodejs v4。尝试升级到具有更好ES6支持的nodejs v6,并且可能更新一些npm依赖项。

  

npm ERR! node v4.6.0

相关问题