简体   繁体   English

我正在尝试使用 npm parcel -g 命令全局安装 Parcel

[英]I am trying to install Parcel globally using the npm parcel -g command

I am trying to install Parcel globally using the npm parcel -g command and I get an error message when I use parcel index.html stating no entries found.我正在尝试使用 npm parcel -g 命令全局安装 Parcel,当我使用 parcel index.html 时收到一条错误消息,指出未找到任何条目。 What can I do to fix this?我能做些什么来解决这个问题?

Here is the command I enter to install parcel globally.这是我输入的用于全局安装parcel的命令。

PS C:\\Users\\User\\Desktop\\Moshify> npm i -g parcel-bundler npm WARN deprecated parcel-bundler@1.12.5: Parcel v1 is no longer maintained. PS C:\\Users\\User\\Desktop\\Moshify> npm i -g parcel-bundler npm WARN deprecated parcel-bundler@1.12.5: Parcel v1 不再维护。 Please migrate to v2, which is published under the 'parcel' package.请迁移到 v2,它发布在 'parcel' 包下。 See https://v2.parceljs.org/getting-started/migration for details.有关详细信息,请参阅https://v2.parceljs.org/getting-started/migration npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. npm WARN deprecated core-js@2.6.12: core-js@<3.3 不再维护,由于问题数量不推荐使用。 Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up tonpm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+.由于 V8 引擎的奇思妙想,旧 core-js 版本中的功能检测可能会导致速度减慢Upgrade to chokidar 3 with 15x less dependencies.升级到 chokidar 3,依赖项减少 15 倍。 npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. npm WARN 已弃用 fsevents@1.2.13:fsevents 1 将在节点 v14+ 上中断,并且可能使用不安全的二进制文件。 Upgrade to fsevents 2. npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142升级到 fsevents 2. npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: 请参阅https://github.com/ lydell/urix#deprecated npm WARN deprecated request@2.88.2: request 已被弃用,参见https://github.com/request/request/issues/3142
npm WARN deprecated request-promise-native@1.0.9: 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 har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. npm WARN deprecated request-promise-native@1.0.9: request-promise-native 已被弃用,因为它扩展了现在已弃用的请求包,请参阅https://github.com/request/request/issues/3142 npm WARN deprecated har -validator@5.1.5:不再支持此库 npm WARN 已弃用 uuid@3.4.0:请升级到版本 7 或更高版本。 Older versions may use Math.random() in certain circumstances, which is known to be problematic.旧版本可能会在某些情况下使用 Math.random(),这是众所周知的问题。 See https://v8.dev/blog/math-random for details.有关详细信息,请参阅https://v8.dev/blog/math-random C:\\Users\\User\\AppData\\Roaming\\npm\\parcel -> C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\bin\\cli.js C:\\Users\\User\\AppData\\Roaming\\npm\\parcel -> C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\bin\\cli.js

parcel-bundler@1.12.5 postinstall C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler node -e "console.log('\\Love Parcel? You can now donate to our open collective:\\\\n > \https://opencollective.com/parcel/donate\')" parcel-bundler@1.12.5 postinstall C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler node -e "console.log('\\Love Parcel?你现在可以捐赠给我们的公开集体:\\\\n > \https://opencollective.com/parcel/donate\')”

Love Parcel?爱包裹? You can now donate to our open collective:您现在可以向我们的公开集体捐款:

https://opencollective.com/parcel/donate npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\\parcel-bundler\\node_modules\\chokidar\\node_modules\\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) https://opencollective.com/parcel/donate npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\\parcel-bundler\\node_modules\\chokidar\\node_modules\\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported OPTIONAL DEP fsevents@1.2.13:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch":"x64"})

  • parcel-bundler@1.12.5 updated 1 package in 25.129s parcel-bundler@1.12.5 在 25.129 秒内更新了 1 个包

Here is where I try to call the server and the error message I am getting.这是我尝试调用服务器和我收到的错误消息的地方。

PS C:\\Users\\User\\Desktop\\Moshify> parcel index.html Server running at http://localhost:1234 × No entries found. PS C:\\Users\\User\\Desktop\\Moshify>parcel index.html 服务器运行在 http://localhost:1234 × 未找到条目。 at Bundler.bundle (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\src\\Bundler.js:275:17) at async Bundler.serve (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\src\\Bundler.js:842:7)在 Bundler.bundle (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\src\\Bundler.js:275:17) at async Bundler.serve (C:\\Users\\User\\AppData\\Roaming \\npm\\node_modules\\parcel-bundler\\src\\Bundler.js:842:7)
at async Command.bundle (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\src\\cli.js:241:20)在 async Command.bundle (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\parcel-bundler\\src\\cli.js:241:20)

At first you need to initialize you npm package for package.json file.首先,您需要为 package.json 文件初始化 npm 包。

using that command npm init -yes .使用该命令npm init -yes Create a default package.json file.创建一个默认的 package.json 文件。

Then need to install it globally using this command :然后需要使用以下命令全局安装它:

npm install parcel-bundler -g

Also you can try to save it in your package.json file.您也可以尝试将其保存在 package.json 文件中。

npm install parcel-bundler -g --save-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM