2016-06-22 66 views
4

下面是我的package.json文件。npm国家模块丢失不是

{ 
    "name": "test", 
    "version": "1.0.0", 
    "description": "web_app", 
    "main": "index.js", 
    "scripts": { 
    "test": "echo \"Error: no test specified\" && exit 1" 
    }, 
    "author": "Brad", 
    "license": "ISC", 
    "devDependencies": { 
    "babel-preset-es2015": "^6.9.0", 
    "browser-sync": "^2.13.0", 
    "del": "^2.2.0", 
    "gulp": "^3.9.1", 
    "gulp-autoprefixer": "^3.1.0", 
    "gulp-babel": "^6.1.2", 
    "gulp-changed": "^1.3.0", 
    "gulp-cssnano": "^2.1.2", 
    "gulp-file-include": "^0.13.7", 
    "gulp-htmlmin": "^2.0.0", 
    "gulp-if": "^2.0.1", 
    "gulp-sass": "^2.3.2", 
    "gulp-size": "^2.1.0", 
    "gulp-sourcemaps": "^1.6.0", 
    "gulp-uglify": "^1.5.3", 
    "gulp-uncss": "^1.0.5", 
    "gulp-useref": "^3.1.0", 
    "htmlmin": "0.0.6", 
    "run-sequence": "^1.2.1" 
    }, 
    "dependencies": { 
    "rxjs-es": "^5.0.0-beta.9" 
    } 
} 

当运行“故宫安装”我得到以下错误:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: [email protected]<3.0.0 is no longer maintained. Upgrade to [email protected]^4.0.0. 
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
npm WARN prefer global [email protected] should be installed with -g 

由于我没有在我的package.json文件,如“minimatch”模块我假设其他模块依赖于它。所以我在全球安装了所有过时的模块。这并没有删除错误信息。如果我尝试运行说一个吞咽任务,它会工作,但是,如果我重新启动计算机,然后尝试运行相同的吞咽任务,它会说模块丢失,即使它们在node_modules文件夹中。有任何想法吗?

回答

2

是的,您的依赖项正在使用不推荐的包。

尝试运行npm ls查找哪些依赖关系引用了旧包。

enter image description here

+0

,做清单的一切,但你怎么应该更新这些包?运行'npm过时'不会返回任何内容并且运行'npm update'不会更新它们 –

+1

正确。过时的npm只会显示已列为依赖关系的过时包,直至包的发布者更新已弃用的包,以便您可以使用不同的包,或者如果它们不包含警告(不重要)代表了一个问题或安全漏洞。 –

+0

那么如果这不是问题,没有人知道为什么我需要重新安装所有模块,每次我重新启动我的比较。 –

0

更新minimatch到最新的3.0.2版本,运行以下命令

npm update -g [email protected] 
+0

不工作:(:( –

+0

对我来说,它降级后我的Node.js版本 –