无法使用[npm i --save-dev Parcel]安装parcel

问题描述 投票:0回答:2

我正在尝试安装parcel并使用官方文档中给出的命令

npm install --save-dev parcel

它输出一些警告,指出它已被弃用,并且错误如下。

npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path D:\Courses\Front-End\Workspace\Trainings & Challenges\Jonas Schmedtman\17-Modern JS\node_modules\lmdb-store
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
npm ERR! The system cannot find the path specified.
npm ERR! internal/modules/cjs/loader.js:905
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'D:\Courses\Front-End\Workspace\node-gyp-build\bin.js'
npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
npm ERR!     at internal/main/run_main_module.js:17:47 {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: []
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Muhammad\AppData\Local\npm-cache\_logs\2021-12-22T14_51_13_204Z-debug-0.log

这是截图:

Error Screenshot

最终没有安装parcel。请提供任何帮助。 我在 Win 11 上使用 VS code。

npm parcel
2个回答
1
投票

今天我耐心地再次尝试安装包裹,结果成功了。 事实证明,我的地址中有一个带有&符号

&
的文件夹,即使文件夹名称包含空格,也会导致问题。奇怪的是其他软件包安装成功而没有任何问题。

旧地址:

D:\Courses\Front-End\Workspace\Trainings & Challenges\Jonas Schmedtman\17-Modern JS

新地址:

D:\Courses\Front-End\Workspace\Trainings Challenges\Jonas Schmedtman\17-Modern JS

0
投票

如果经过验证的答案对您不起作用:- 我卸载了node并下载了最新版本,允许它在安装过程中安装其他应用程序,例如python并运行

npm i parcel --save-dev
在 Visual Studio 的终端中,它运行时没有错误。

© www.soinside.com 2019 - 2024. All rights reserved.