- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试设置一个 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/
我正在学习构建单页应用程序 (SPA) 所需的所有技术。总而言之,我想将我的应用程序实现为单独的层,其中前端仅使用 API Web 服务(json 通过 socket.io)与后端通信。前端基本上是
当我看到存储在我的数据库中的日期时。 这是 正常 。日期和时间就是这样。 但是当我运行 get 请求来获取数据时。 此格式与存储在数据库 中的格式不同。为什么会发生这种情况? 最佳答案 我认为您可以将
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我正在尝试使用backbone.js 实现一些代码 和 hogan.js (http://twitter.github.com/hogan.js/) Hogan.js was developed ag
我正在使用 Backbone.js、Node.js 和 Express.js 制作一个 Web 应用程序,并且想要添加用户功能(登录、注销、配置文件、显示内容与该用户相关)。我打算使用 Passpor
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 8 年前。 Improve this ques
我尝试在 NodeJS 中加载数据,然后将其传递给 ExpressJS 以在浏览器中呈现 d3 图表。 我知道我可以通过这种方式加载数据 - https://github.com/mbostock/q
在 node.js 中,我似乎遇到了相同的 3 个文件名来描述应用程序的主要入口点: 使用 express-generator 包时,会创建一个 app.js 文件作为生成应用的主要入口点。 通过 n
最近,我有机会观看了 john papa 关于构建单页应用程序的精彩类(class)。我会喜欢的。它涉及服务器端和客户端应用程序的方方面面。 我更喜欢客户端。在他的实现过程中,papa先生在客户端有类
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我是一个图形新手,需要帮助了解各种 javascript 2D 库的功能。 . . 我从 Pixi.js 中得到了什么,而我没有从 Konva 等基于 Canvas 的库中得到什么? 我从 Konva
我正在尝试将一些 LESS 代码(通过 ember-cli-less)构建到 CSS 文件中。 1) https://almsaeedstudio.com/ AdminLTE LESS 文件2) Bo
尝试查看 Express Passport 中所有登录用户的所有 session ,并希望能够查看当前登录的用户。最好和最快的方法是什么? 我在想也许我可以在登录时执行此操作并将用户模型数据库“在线”
我有一个 React 应用程序,但我需要在组件加载完成后运行一些客户端 js。一旦渲染函数完成并加载,运行与 DOM 交互的 js 的最佳方式是什么,例如 $('div').mixItUp() 。对
请告诉我如何使用bodyparser.raw()将文件上传到express.js服务器 客户端 // ... onFilePicked(file) { const url = 'upload/a
我正在尝试从 Grunt 迁移到 Gulp。这个项目在 Grunt 下运行得很好,所以我一定是在 Gulp 中做错了什么。 除脚本外,所有其他任务均有效。我现在厌倦了添加和注释部分。 我不断收到与意外
我正在尝试更改我的网站名称。找不到可以设置标题或应用程序名称的位置。 最佳答案 您可以在 config/ 目录中创建任何文件,例如 config/app.js 包含如下内容: module.expor
经过多年的服务器端 PHP/MySQL 开发,我正在尝试探索用于构建现代 Web 应用程序的新技术。 我正在尝试对所有 JavaScript 内容进行排序,如果我理解得很好,一个有效的解决方案可以是服
我是 Nodejs 的新手。我在 route 目录中有一个 app.js 和一个 index.js。我有一个 app.use(multer....)。我还定义了 app.post('filter-re
我正在使用 angular-seed用于构建我的应用程序的模板。最初,我将所有 JavaScript 代码放入一个文件 main.js。该文件包含我的模块声明、 Controller 、指令、过滤器和
我是一名优秀的程序员,十分优秀!