Node.js npm在windows计算机上启动失败,但在ubuntu上运行
我遵循本教程学习GraphQL的基础知识。在我尝试运行此命令的整个过程之后,Node.js npm在windows计算机上启动失败,但在ubuntu上运行,node.js,npm,graphql,npm-start,Node.js,Npm,Graphql,Npm Start,我遵循本教程学习GraphQL的基础知识。在我尝试运行此命令的整个过程之后,npm start在windows上失败,但在我的linux机器上运行的是相同的命令。有人能告诉我这里缺少什么吗?。错误是 npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules
npm start
在windows上失败,但在我的linux机器上运行的是相同的命令。有人能告诉我这里缺少什么吗?。错误是
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules
\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! github-graphql-server@1.0.0 start: `babel-node --presets es2015 ./server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-graphql-server@1.0.0 start script 'babel-node --presets es2015 ./server.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 github-graphql-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel-node --presets es2015 ./server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs github-graphql-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls github-graphql-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\my\github-graphql-server\npm-debug.log
我认为这两个可以解决我的问题,而且博客评论也表明了这一点
清理智能引号,并使用hypens而不是破折号。
npm错误!告诉作者此操作在您的系统上失败:
npm错误!babel节点——预设es2015./server.js
mypackage.json上的启动程序文件
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./node_modules/.bin/babel-node --presets es2015 ./server.js"
},
"dependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-node": "^6.1.1",
"express": "^4.15.4",
"express-graphql": "^0.6.7",
"graphql": "^0.10.5"
}
对包.json的其他依赖项
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./node_modules/.bin/babel-node --presets es2015 ./server.js"
},
"dependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-node": "^6.1.1",
"express": "^4.15.4",
"express-graphql": "^0.6.7",
"graphql": "^0.10.5"
}