简体   繁体   English

无法执行npm启动

[英]Failed to execute npm start

I have setup a vagrant virtual machine and installed nodejs (v 6.9.1) and npm (v 4.0.0). 我已经安装了一个无用的虚拟机,并安装了nodejs(v 6.9.1)和npm(v 4.0.0)。 Cloned a nodejs app with git clone and executed npm install command in root folder as well as app folder. 使用git clone克隆了一个nodejs应用,并在根文件夹和应用文件夹中执行了npm install命令。 However when I try to start the app via npm start , it fails 但是,当我尝试通过npm start启动应用npm start ,它失败

Stack: 堆:

vagrant@vagrant-ubuntu-trusty-64:~/work/newair/app$ npm start -verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'start', '-verbose' ]
npm info using npm@4.0.0
npm info using node@v6.9.1
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle pykihAIR@0.4.0~prestart: pykihAIR@0.4.0
npm info lifecycle pykihAIR@0.4.0~start: pykihAIR@0.4.0

> pykihAIR@0.4.0 start /home/vagrant/work/newair/app
> electron main.js


npm verb lifecycle pykihAIR@0.4.0~start: unsafe-perm in lifecycle true
npm verb lifecycle pykihAIR@0.4.0~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/vagrant/work/newair/app/node_modules/.bin:/home/vagrant/.rvm/gems/ruby-2.3.0/bin:/home/vagrant/.rvm/gems/ruby-2.3.0@global/bin:/home/vagrant/.rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vagrant/.rvm/bin:/home/vagrant/.rvm/bin
npm verb lifecycle pykihAIR@0.4.0~start: CWD: /home/vagrant/work/newair/app
npm info lifecycle pykihAIR@0.4.0~start: Failed to exec start script
npm verb stack Error: pykihAIR@0.4.0 start: `electron main.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:277:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:877:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid pykihAIR@0.4.0
npm verb cwd /home/vagrant/work/newair/app
npm ERR! Linux 3.13.0-100-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start" "-verbose"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.0
npm ERR! code ELIFECYCLE
npm ERR! pykihAIR@0.4.0 start: `electron main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pykihAIR@0.4.0 start script 'electron main.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pykihAIR package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pykihAIR
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pykihAIR
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/work/newair/app/npm-debug.log

After discussing through the comments, it seems that the electron package is not installed. 通过评论进行讨论后,似乎未安装electron封装。

You can install locally by running npm install --save electron , use the --save flag to write it's definition inside your package.json file. 您可以通过运行npm install --save electron在本地npm install --save electron ,使用--save标志将其定义写入package.json文件中。

If you want it to be global, you can run npm install -g electron , you'll be able to execute it anywhere else on your machine. 如果您希望它是全局的,则可以运行npm install -g electron ,您可以在计算机上的其他任何地方执行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM