gpt4 book ai didi

node.js - 明显 ENOENT : no such file or directory,

转载 作者:太空宇宙 更新时间:2023-11-04 03:02:11 27 4
gpt4 key购买 nike

 C:\Users\shagy\Desktop\3RD YEAR 2ND SEMESTER\SPM\Newfolder\SPM-SMS>npm start 
npm ERR! path C:\Users\shagy\Desktop\3RD YEAR 2ND SEMESTER\SPM\New folder\SPM-SMS\package.json npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\shagy\Desktop\3RD YEAR 2ND SEMESTER\SPM\New folder\SPM-SMS\package.json'
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\shagy\AppData\Roaming\npm-cache\_logs\2018-09-05T14_23_49_736Z-debug.log

如何解决这个问题?即使在 npm install 之后,也会出现此错误

最佳答案

这与 npm 找不到文件有关。错误消息 npm ERR! enoent 告诉您找不到该文件。

首先检查该文件是否确实存在于您的文件系统中的该路径下,并检查您用来调用该文件的引用路径是否存在可能的拼写错误。

如果这是一个新项目,您可以调用

npm init 

Node 将初始化您的项目并为您创建一个package.json..

来自官方文档:

Description:npm init can be used to set up a new or existing npm package.

initializer in this case is an npm package named create-, which >will be installed by npx, and then have its main bin executed -- presumably >creating or updating package.json and running any other initialization-related >operations.

The init command is transformed to a corresponding npx operation as follows:

  • npm init foo -> npx create-foo
  • npm init @usr/foo -> npx @usr/create-foo
  • npm init @usr -> npx @usr/create

Any additional options will be passed directly to the command, so npm init foo --hello will map to npx create-foo --hello.

If the initializer is omitted (by just calling npm init), init will fall back to legacy init behavior. It will ask you a bunch of questions, and then write a package.json for you. It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. It is strictly additive, so it will keep any fields and values that were already set. You can also use -y/--yes to skip the questionnaire altogether. If you pass --scope, it will create a scoped package.

更多详细信息请阅读npm init的官方文档.

关于node.js - 明显 ENOENT : no such file or directory,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52187582/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com