簡體   English   中英

在 vs 代碼中運行 npm start 時出現錯誤

[英]I get error when running npm start in vs code

(node:6852) [LRU_CACHE_OPTION_maxAge] DeprecationWarning: The maxAge option is deprecated. please use options.ttl instead
(Use `node --trace-deprecation ...` to show where the warning was created)

> mynodejsapp@0.0.0 start
> node ./bin/www

npm ERR! code ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\MinGW\bin
npm ERR! path C:\Users\TECHNOCITY9645075247\Desktop\web designing\myNodejsApp
npm ERR! errno -4058
npm ERR! enoent spawn C:\Windows\system32\cmd.exe;C:\MinGW\bin ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\TECHNOCITY9645075247\AppData\Local\npm-cache\_logs\2022-03-13T10_44_05_635Z-debug-0.logenter code here

這是終端中顯示的錯誤,我的節點和 npm 版本是最新的

嘗試重新安裝 Node.js。 應該像它對我一樣工作。

卸載 Node.js

  1. 通過在終端中運行以下命令來清除 npm 緩存。

    npm 緩存清理 --force

  2. 進入windows控制面板,點擊卸載程序,選擇Node.js,點擊卸載選項卡,成功卸載節點和npm。

重新啟動系統。

  1. 使用以下命令驗證 node.js 和 npm 是否已從您的系統中完全卸載:

    節點-v

如果上面的命令打印命令未找到,那么您已成功卸載,否則請查看以下目錄並手動刪除內容。

C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)

看起來你正面臨使用maxAge而不是expires的問題看這個鏈接Can't set cookie 'expires' or 'maxAge' in Node.js using Express 3.0

也許可以幫助您更好地解決問題。

嘗試清理緩存,然后重新安裝 Node.js。 應該像它對我一樣工作。

嘗試重新安裝 Node.js。 應該像它對我一樣工作。

暫無
暫無

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

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