gpt4 book ai didi

node.js - Yo MEAN 生成器崩溃

转载 作者:搜寻专家 更新时间:2023-10-31 23:59:50 29 4
gpt4 key购买 nike

我正在尝试设置一个 MEAN 项目,但似乎无法让生成器工作。我使用以下命令安装了 meanjs 生成器:

npm -g install generator-meanjs

我运行了 yo meanjs 并回答了有关我的应用程序的问题,但生成器总是崩溃。

这是我收到的消息:

Running npm install for you....
This may take a couple minutes.
Error: Command failed: /bin/sh -c cd mean && npm install
npm WARN deprecated phantomjs@2.1.7: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
Killed

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)

我已经尝试了所有 MEAN 版本选项,但没有任何改变。以下是运行命令后我的文件夹结构:

bower.json          Dockerfile     LICENSE.md    package.json        README.md
config gruntfile.js manifest.yml Procfile scripts
CONTRIBUTING.md gulpfile.js modules protractor.conf.js server.js
docker-compose.yml karma.conf.js node_modules public test.js

我能够通过进入 package.json 并将 phantomjs 依赖项重命名为 phantomjs-prebuilt 并重新运行 npm install< 来修复第一个警告。但是我找不到文件中提到的其他依赖项,甚至不知道这个解决方案是否能解决我的问题。

我正在运行 Ubuntu 14 和 Python 2.7(我的研究暗示这可能很重要,以防万一)。

编辑
还有一件事:在安装 meanjs 生成器时,我收到了两个弃用警告...我认为这不会导致问题,但这会是罪魁祸首吗?

root@area51:~# npm install -g generator-meanjs
npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm

这是我的 package.json 文件:

{
"name": "mean",
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js",
"version": "0.4.2",
"meanjs-version": "0.4.2",
"private": false,
"author": "Danny",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/meanjs/mean.git"
},
"engines": {
"node": ">=0.10.28",
"npm": ">=1.4.28"
},
"scripts": {
"start": "grunt",
"test": "grunt test",
"postinstall": "bower install --config.interactive=false"
},
"dependencies": {
"acl": "~0.4.4",
"async": "^1.3.0",
"body-parser": "^1.13.1",
"bower": "^1.4.1",
"cfenv": "~1.0.0",
"chalk": "^1.1.0",
"compression": "^1.5.0",
"connect-flash": "~0.1.1",
"connect-mongo": "~0.8.1",
"consolidate": "~0.13.1",
"cookie-parser": "^1.3.2",
"crypto": "0.0.3",
"express": "^4.13.1",
"express-session": "^1.11.3",
"file-stream-rotator": "~0.0.6",
"forever": "~0.14.2",
"generate-password": "^1.1.1",
"glob": "^5.0.13",
"grunt": "0.4.5",
"grunt-cli": "~0.1.13",
"helmet": "~0.9.1",
"jasmine-core": "^2.3.4",
"lodash": "^3.10.0",
"method-override": "^2.3.3",
"mocha": "~1.20.0",
"mongoose": "~4.2.3",
"morgan": "^1.6.1",
"multer": "~1.0.5",
"nodemailer": "^1.4.0",
"owasp-password-strength-test": "^1.3.0",
"passport": "~0.2.2",
"passport-facebook": "^2.0.0",
"passport-github": "~0.1.5",
"passport-google-oauth": "~0.2.0",
"passport-linkedin": "~0.1.3",
"passport-local": "^1.0.0",
"passport-paypal-openidconnect": "^0.1.1",
"passport-twitter": "^1.0.2",
"phantomjs": ">=1.9.0",
"serve-favicon": "^2.3.0",
"socket.io": "^1.3.7",
"swig": "^1.4.2",
"validator": "^3.41.2"
},
"devDependencies": {
"coveralls": "^2.11.4",
"grunt-concurrent": "^2.0.0",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-csslint": "~0.4.0",
"grunt-contrib-cssmin": "~0.12.3",
"grunt-contrib-jshint": "~0.11.2",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-sass": "~0.9.2",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-env": "~0.4.4",
"grunt-eslint": "~17.3.1",
"grunt-karma": "~0.11.2",
"grunt-mocha-istanbul": "^2.4.0",
"grunt-mocha-test": "~0.12.7",
"grunt-ng-annotate": "^1.0.1",
"grunt-node-inspector": "~0.3.0",
"grunt-nodemon": "~0.4.0",
"grunt-protractor-coverage": "~0.2.15",
"grunt-protractor-runner": "^2.1.0",
"gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.7.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-concat": "^2.6.0",
"gulp-csslint": "~0.1.5",
"gulp-cssmin": "~0.1.7",
"gulp-eslint": "~1.0.0",
"gulp-jshint": "^1.11.2",
"gulp-karma": "~0.0.4",
"gulp-less": "^3.0.3",
"gulp-livereload": "^3.8.0",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-mocha": "^2.1.2",
"gulp-ng-annotate": "^1.0.0",
"gulp-nodemon": "^2.0.3",
"gulp-protractor": "^1.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.3",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"karma": "~0.12.37",
"karma-chrome-launcher": "~0.2.0",
"karma-coverage": "~0.4.2",
"karma-firefox-launcher": "~0.1.6",
"karma-jasmine": "~0.3.6",
"karma-ng-html2js-preprocessor": "^0.1.2",
"karma-phantomjs-launcher": "~0.2.0",
"load-grunt-tasks": "^3.2.0",
"mock-fs": "~3.4.0",
"run-sequence": "^1.1.1",
"should": "^7.0.1",
"supertest": "^1.0.1"
}
}

另一个编辑
好的,我可以通过清除我的 npm 缓存并运行 yo meanjs --skip0install 来安装包(我认为)。克隆 repo 之后,我运行了 sudo npm install 并且没有收到我上面提到的 KILLED 消息。但是,所有警告和弃用通知仍然存在,当我尝试使用 grunt 运行服务器时,我得到:

grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

我尝试使用 npm install grunt-cli 手动安装 grunt,但我收到了相同的消息。我注意到所有的 grunt 工具都在 package.json 中引用,所以我想知道是否可能没有安装 devDependencies。

现在我遇到了内存泄漏......

(node:11181) Warning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit

怎么这么乱?

最佳答案

不确定是否有任何帮助,但检查我的 package.json 文件,运行 npm install

没有问题
{
"name": "mean"
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js",
"version": "0.4.2",
"meanjs-version": "0.4.2",
"private": false,
"author": "Amy",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/meanjs/mean.git"
},
"engines": {
"node": ">=0.10.28",
"npm": ">=1.4.28"
},
"scripts": {
"start": "node server.js",
"test": "grunt test",
"postinstall": "bower install --config.interactive=false"
},
"dependencies": {
"acl": "~0.4.4",
"async": "^1.3.0",
"body-parser": "^1.13.1",
"bower": "^1.4.1",
"cfenv": "~1.0.0",
"chalk": "^1.1.0",
"compression": "^1.5.0",
"connect-flash": "~0.1.1",
"connect-mongo": "~0.8.1",
"consolidate": "~0.13.1",
"cookie-parser": "^1.3.2",
"crypto": "0.0.3",
"express": "^4.13.1",
"express-session": "^1.11.3",
"file-stream-rotator": "~0.0.6",
"forever": "~0.14.2",
"generate-password": "^1.1.1",
"glob": "^5.0.13",
"grunt": "0.4.5",
"grunt-cli": "~0.1.13",
"helmet": "~0.9.1",
"jasmine-core": "^2.3.4",
"lodash": "^3.10.0",
"method-override": "^2.3.3",
"mocha": "~1.20.0",
"moment-timezone": "^0.5.5",
"mongoose": "~4.2.3",
"morgan": "^1.6.1",
"multer": "~1.0.5",
"nodemailer": "^1.4.0",
"owasp-password-strength-test": "^1.3.0",
"passport": "~0.2.2",
"passport-facebook": "^2.0.0",
"passport-github": "~0.1.5",
"passport-google-oauth": "~0.2.0",
"passport-linkedin": "~0.1.3",
"passport-local": "^1.0.0",
"passport-paypal-openidconnect": "^0.1.1",
"passport-twitter": "^1.0.2",
"phantomjs": ">=1.9.0",
"serve-favicon": "^2.3.0",
"socket.io": "^1.3.7",
"stripe": "^4.9.0",
"swig": "^1.4.2",
"validator": "^3.41.2"
},
"devDependencies": {
"coveralls": "^2.11.4",
"grunt-concurrent": "^2.0.0",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-csslint": "~0.4.0",
"grunt-contrib-cssmin": "~0.12.3",
"grunt-contrib-jshint": "~0.11.2",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-sass": "~0.9.2",
"grunt-contrib-uglify": "~0.9.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-env": "~0.4.4",
"grunt-eslint": "~17.3.1",
"grunt-karma": "~0.11.2",
"grunt-mocha-istanbul": "^2.4.0",
"grunt-mocha-test": "~0.12.7",
"grunt-ng-annotate": "^1.0.1",
"grunt-node-inspector": "~0.3.0",
"grunt-nodemon": "~0.4.0",
"grunt-protractor-coverage": "~0.2.15",
"grunt-protractor-runner": "^2.1.0",
"gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.7.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-concat": "^2.6.0",
"gulp-csslint": "~0.1.5",
"gulp-cssmin": "~0.1.7",
"gulp-eslint": "~1.0.0",
"gulp-jshint": "^1.11.2",
"gulp-karma": "~0.0.4",
"gulp-less": "^3.0.3",
"gulp-livereload": "^3.8.0",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-mocha": "^2.1.2",
"gulp-ng-annotate": "^1.0.0",
"gulp-nodemon": "^2.0.3",
"gulp-protractor": "^1.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.3",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"karma": "~0.12.37",
"karma-chrome-launcher": "~0.2.0",
"karma-coverage": "~0.4.2",
"karma-firefox-launcher": "~0.1.6",
"karma-jasmine": "~0.3.6",
"karma-ng-html2js-preprocessor": "^0.1.2",
"karma-phantomjs-launcher": "~0.2.0",
"load-grunt-tasks": "^3.2.0",
"mock-fs": "~3.4.0",
"run-sequence": "^1.1.1",
"should": "^7.0.1",
"supertest": "^1.0.1"
}
}

关于node.js - Yo MEAN 生成器崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39005194/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com