2016-06-22 86 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版本 –