日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

npm报错

發布時間:2023/12/10 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 npm报错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

目錄

一、問題:404 Not Found - GET https://registry.npmjs.org/** - Not found

二、問題:yarn : 無法加載文件 C:\Users\**\AppData\Roaming\npm\yarn.ps1,因為在此系統上禁止運行腳本。

三、問題:error An unexpected error occurred: "http://npm.company.com/**/-/**-3.26.17.tgz: unexpected end of file".

四、yarn dev:cross-env CODE_ENV=local cooking watch -p 'cooking' 不是內部或外部命令,也不是可運行的程序或批處理文件。

五、npm ERR! xxx@0.1.0 dev: `cross-env CODE_ENV=dev vue-cli-service build


記錄使用npm時各類報錯

一、問題:404 Not Found - GET https://registry.npmjs.org/** - Not found

npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/**-core - Not found npm ERR! 404 npm ERR! 404 '**-core@1.7.7' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 tarball, folder, http url, or git url. npm ERR! C:\Users\***\AppData\Roaming\npm-cache\_logs\2021-07-26T03_12_06_731Z-debug.log

解決方案:?

?1、查看一下是否設置代理:

npm config set proxy npm config get https-proxy

2、以上兩個命令如果返回null,那么就不需要執行以下命令清理

npm config set https-proxy null npm config get proxy null

3、重新設置:

npm config set registry https://registry.npmjs.org/

若無效,則嘗試:

npm config set registry https://skimdb.npmjs.com/registry

或者如果不起作用,請嘗試 GitHub 鏈接:

npm config set registry https://github.com/npm/npm-registry-couchapp

二、問題:yarn : 無法加載文件 C:\Users\**\AppData\Roaming\npm\yarn.ps1,因為在此系統上禁止運行腳本。

yarn : 無法加載文件 C:\Users\**\AppData\Roaming\npm\yarn.ps1,因為在此系統上禁止運行 腳本。有關詳細信息,請參閱 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Executi on_Policies。 所在位置 行:1 字符: 1 + yarn dev + ~~~~+ CategoryInfo : SecurityError: (:) [],PSSecurityException+ FullyQualifiedErrorId : UnauthorizedAccess

解決方案:?

1、搜索cmd,以管理員方式運行powershell
2、使用命令更改計算機的執行策略:set-ExecutionPolicy RemoteSigned

PS C:\windows\system32> set-ExecutionPolicy RemoteSigned執行策略更改 執行策略可幫助你防止執行不信任的腳本。更改執行策略可能會產生安全風險,如 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies 幫助主題所述。是否要更改執行策略? [Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暫停(S) [?] 幫助 (默認值為“N”): y

3、查看當前執行策略:

PS C:\windows\system32> get-ExecutionPolicy RemoteSigned

三、問題:error An unexpected error occurred: "http://npm.company.com/**/-/**-3.26.17.tgz: unexpected end of file".

error An unexpected error occurred: "http://npm.company.com/**/-/**-3.26.17.tgz: unexpected end of file". info If you think this is a bug, please open a bug report with the information provided in "D:\\code\\**\\**\\yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. info There appears to be trouble with your network connection. Retrying...

解決方案:

配置公司鏡像源

nrm add **

如果執行報錯,參考?nrm 安裝完成但 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value);_a806488840的博客-CSDN博客

四、yarn dev:cross-env CODE_ENV=local cooking watch -p 'cooking' 不是內部或外部命令,也不是可運行的程序或批處理文件。

PS D:\code\**\**-Frontend> yarn dev yarn run v1.22.10 $ cross-env CODE_ENV=local cooking watch -p 'cooking' 不是內部或外部命令,也不是可運行的程序 或批處理文件。

嘗試解決:

npm install -g cooking npm install -g cooking-cli

后又報錯:

$ cross-env CODE_ENV=local cooking watch -p[cooking@1.5.4] - chalk.yellow('permission denied')Try running with sudo or get accesssudo chown -R $USER:$(id -gn $USER) C:\Users\**\.cookingerror Command failed with exit code 1.

解決方案:

原node版本為14.17.3,切換為12.22.1就不報錯了……

nvm use 12.22.1

五、npm ERR! xxx@0.1.0 dev: `cross-env CODE_ENV=dev vue-cli-service build`

npm run dev報錯:ERROR Build failed with errors. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! quality-measure@1.0.98 deploy_dev: `cross-env CODE_ENV=dev vue-cli-service build && ymm_upload -r ./dist -n qualityMeasure -t dev -z 0 -f 1` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the quality-measure@1.0.98 deploy_dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /data/jenkins/.npm/_logs/2022-02-28T06_35_38_029Z-debug.log

解決方案:

package.json中vuevue-template-compiler版本不一致導致,重新下一個同版本包就可以了

"vue": "^2.5.21", "vue-template-compiler": "^2.5.21"

持續更新……

總結

以上是生活随笔為你收集整理的npm报错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。