簡體   English   中英

npm install 不會創建 node_modules 文件夾

[英]npm install does not make the node_modules folder

我正在嘗試使用 Typescript遵循Protractor官方教程

這是我的package.json

{
  "name": "typescript-exercise",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
"dependencies": {
  "@types/jasmine": "~3.5.7",
  "@types/jasminewd2": "~2.0.8",
  "jasmine": "~3.5.0",
  "protractor": "~5.4.3",
  "typescript": "~3.8.3",
  "ts-node": "~8.6.2",
  "@types/node":"~13.7.7"
 }

}

當我運行 npm install 時,我得到以下結果:

npm WARN typescript-exercise@1.0.0 No description
npm WARN typescript-exercise@1.0.0 No repository field.

up to date in 0.527s
found 0 vulnerabilities

但是,我的根目錄中沒有node_mdules文件夾。

為什么npm install無法構建node_modules

在出現錯誤時,嘗試從package.json刪除空標簽:

{
  "name": "typescript-exercise",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "license": "ISC",
  "dependencies": {
    "@types/jasmine": "~3.5.7",
    "@types/jasminewd2": "~2.0.8",
    "jasmine": "~3.5.0",
    "protractor": "~5.4.3",
    "typescript": "~3.8.3",
    "ts-node": "~8.6.2",
    "@types/node":"~13.7.7"
  }
}

如果你有package-lock.json嘗試刪除它然后運行npm i 希望這對你有用。

嘗試安裝一個依賴項並查看目錄是否已創建或是否出現某種錯誤。該文件可以創建但未正確顯示(您可以根據操作系統使用不同的方法/命令從終端進行測試) .

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM