我使用nvm下载节点v0.4.10并安装了npm以使用该版本的节点.
我正在尝试安装快递使用
npm install express -g
Run Code Online (Sandbox Code Playgroud)
我收到一个表达需要节点版本> = 0.5.0的错误.
好吧,这很奇怪,因为我遵循节点+ express + mongodb教程的指示,这里使用了节点v0.4.10,所以我假设express是/可用于节点v0.4.10.如果我的假设是正确的,我如何告诉npm获取可以使用我的设置的版本?
我正在尝试使用Composer安装特定版本的软件包.我试过composer install
,composer require
但他们正在安装最新版本的软件包.如果我想要旧版本怎么办?
我有一个数据库包装类,它建立与某些MongoDB实例的连接:
async connect(connectionString: string): Promise<void> {
this.client = await MongoClient.connect(connectionString)
this.db = this.client.db()
}
Run Code Online (Sandbox Code Playgroud)
这给了我一个警告:
(node:4833)DeprecationWarning:不推荐使用当前的URL字符串解析器,将来的版本将删除它.要使用新的解析器,请将选项{useNewUrlParser:true}传递给MongoClient.connect.
该connect()
方法接受一个MongoClientOptions
实例作为第二个参数.但它没有一个叫做的属性useNewUrlParser
.我还尝试在连接字符串中设置这些属性,如下所示:mongodb://127.0.0.1/my-db?useNewUrlParser=true
但它对这些警告没有影响.
那么如何设置useNewUrlParser
删除这些警告?这对我很重要,因为脚本应该以cron身份运行,而这些警告会导致垃圾邮件垃圾邮件.
我mongodb
在版本中使用驱动程序3.1.0-beta4
和相应的@types/mongodb
包3.0.18
.它们都是最新的可用npm install
.
使用旧版本的mongodb驱动程序:
connect()
我在Windows 10上,使用Node 5.6.0和npm 3.6.0.我正在尝试将angular-material和mdi安装到我的工作文件夹中.npm install angular-material mdi错误:
+-- angular@1.5.0
+-- UNMET PEER DEPENDENCY angular-animate@^1.5.0
+-- UNMET PEER DEPENDENCY angular-aria@^1.5.0
+-- angular-material@1.0.6
+-- UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57
npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\xxxxx\Desktop\ngClassifieds\package.json'
npm WARN angular-material@1.0.6 requires a peer of
angular-animate@^1.5.0 but none was installed.
npm WARN angular-material@1.0.6 requires a peer of angular-aria@^1.5.0
but none was installed.
npm WARN angular-material@1.0.6 requires a peer of
angular-messages@^1.5.0 but none was installed.
Run Code Online (Sandbox Code Playgroud)
如何解决此问题以安装AngularJS Material和MDI?
composer update
和之间有什么区别composer install
?
配置:macOS High Sierra,版本10.13.2,节点:v8.1.2 npm:5.0.3当我在我的angularjs项目中运行npm start时出现此错误:
ERROR in Cannot find module 'node-sass'
Run Code Online (Sandbox Code Playgroud)
在此之后我运行:
npm i node-sass
Run Code Online (Sandbox Code Playgroud)
现在我收到这个错误:
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
Run Code Online (Sandbox Code Playgroud)
为什么npm不会安装node-sass?我该如何安装node-sass?
所以今天我想使用该命令创建一个新的 Angular 项目ng new <projectname>
,但出现此错误:
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: project-name@0.0.0
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter@"^1.5.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or …
Run Code Online (Sandbox Code Playgroud) 我正在尝试v2.0.0
使用PhantomJS npm
,在尝试了几种方法之后,我找不到一个可行的解决方案......
在NPM上最新版本是1.9.16
,所以我在我的尝试中尝试了以下内容package.json
:
"phantomjs": "https://github.com/ariya/phantomjs/archive/2.0.0.tar.gz"
这给了我一个错误,因为package.json
github repo中没有这个版本.
"phantomjs": "2.0.0"
这告诉我没有这个号码可用的版本.
我在这里错过了什么吗?
需要固定纱线的分辨率特征,还要审核npm audit
吗?有替代纱线npm audit
吗?或者,交替地,将依赖的依赖关系的分辨率工作npm
?
npm ×7
node.js ×5
angularjs ×2
composer-php ×2
npm-install ×2
php ×2
alias ×1
angular ×1
audit ×1
dependencies ×1
express ×1
github ×1
mongodb ×1
mongoose ×1
phantomjs ×1
security ×1
typescript ×1
web ×1
yarnpkg ×1