gpt4 book ai didi

node.js - 如何永远使用 npm

转载 作者:行者123 更新时间:2023-12-03 12:15:11 26 4
gpt4 key购买 nike

我正在尝试在我的 debian 10 vps 中运行此命令 forever start npm start但是我在终端中遇到了这个错误,

warn:    --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: npm
(node:23858) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:23858) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
error: Cannot start forever
error: script /root/node_projects/tiktok/backend/npm does not exist.

这是我的 package.json 文件
{
"name": "auth-graphql",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"engines": {
"node": "10.11.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "node -r esm ./src/index.js",
"start": "nodemon -r esm ./src/index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
...
"esm": "^3.2.0",
...
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"nodemon": "^1.18.4"
}
}

我试过
forever start  esm ./src/index.js

forever start -c "npm start" ./

forever start -c "npm start" /path/dir/

forever --sourceDir /path/dir/ -c "npm start" /

我也遇到了几乎相同的错误,请我需要帮助,我该如何解决这个问题

最佳答案

试试这个命令:

forever start -c "npm start" ./

运行应用程序的特定目录:
forever start -c "npm start" /path/dir/

或使用此命令:
forever --sourceDir /path/dir/ -c "npm start" /

关于node.js - 如何永远使用 npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62236455/

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