gpt4 book ai didi

node.js - npm install 不安装依赖项 - 只是锁定文件

转载 作者:搜寻专家 更新时间:2023-11-01 00:37:13 26 4
gpt4 key购买 nike

我以前从未遇到过让 npm install 工作的任何问题,所以我不确定现在的问题是什么?

我试过运行:

  • npm 安装
  • npm install --save-dev

我第一次让我的 IDE 运行它 (PHPStorm),它创建了 node_modules 文件夹,但里面什么也没有。

然后我删除了它并尝试手动运行它,但它所做的只是创建了 package-lock.json 文件,没有别的,输出是:

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN Invalid version: "1.0"
npm WARN www No description
npm WARN www No repository field.
npm WARN www No README data
npm WARN www No license field.

up to date in 0.087s

现在我以前收到过这些警告,但它们从未引起任何问题。

我的package.json 文件:

{
"name": "**********",
"version": "1.0",
"main": "gulpfile.js",
"devDependencies": {
"autoprefixer": "^6.7.5",
"gulp": "^3.9.1",
"gulp-clean-css": "^2.0.13",
"gulp-concat": "^2.6.0",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^6.3.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7"
},
"private": true
}

然后我运行了 npm install --save-dev --loglevel verbose,这是输出:

npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\Brett\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--save-dev',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using npm@5.5.1
npm info using node@v6.9.1
npm verb npm-session 24ddfff75bdd69e7
npm verb correctMkdir C:\Users\Brett\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\Brett\AppData\Roaming\npm-cache\_locks\staging-822c9c4b46ec75df.lock for D:\******************\node_modules\.staging
npm verb unlock done using C:\Users\Brett\AppData\Roaming\npm-cache\_locks\staging-822c9c4b46ec75df.lock for D:\****************\node_modules\.staging
npm info linkStuff !invalid#1
npm verb linkBins !invalid#1
npm verb linkMans !invalid#1
npm info lifecycle undefined~install: undefined
npm info lifecycle undefined~postinstall: undefined
npm info lifecycle undefined~prepublish: undefined
npm info lifecycle undefined~prepare: undefined
npm verb saving []
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN Invalid version: "1.0"
npm WARN www No description
npm WARN www No repository field.
npm WARN www No README data
npm WARN www No license field.

up to date in 0.057s
npm verb exit [ 0, true ]
npm info ok

这里有什么问题?

最佳答案

好吧,似乎即使它只是一个WARN,但问题是版本。

我所要做的就是将它从 1.0 更改为 1.0.0 然后它开始工作了。

关于node.js - npm install 不安装依赖项 - 只是锁定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47363932/

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