创建了一个用于构建API的nodeJs应用程序。该应用程序在本地工作,但当试图将其推送到Heroku时,出现了构建错误。所以尝试先在本地构建,但得到了一个错误。yarn start build
nps is executing `build` : nps banner.build && nps config && nps lint && nps clean.dist && nps copy && nps copy.tmp && nps clean.tmp
nps is executing `banner.build` : ts-node --transpile-only ./commands/banner.ts build
_ _ _ _
| |__ _ _(_) | __| |
| '_ \| | | | | |/ _` |
| |_) | |_| | | | (_| |
|_.__/ \__,_|_|_|\__,_|
nps is executing `config` : ts-node --transpile-only ./commands/tsconfig.ts
nps is executing `lint` : tslint -c ./tslint.json ./src/**/*.ts --format stylish
nps is executing `clean.dist` : node node_modules/rimraf/bin.js ./dist
nps is executing `copy` : nps copy.public
nps is executing `copy.public` : copyfiles --up 1 ./src/public/* ./dist
nps is executing `copy.tmp` : ncp ./.tmp/src ./dist
There were errors during the copy.
错误:ENOENT:没有这样的文件或目录,lstat
JavaScript新手,所以需要一个解决方案来修复它。
谢谢你
尝试:
1.清除缓存
1.节点模块
1.升级到最新版本
1条答案
按热度按时间q9rjltbz1#
上面的错误显示“tmp/src”文件夹丢失,这可能是因为您在构建node js应用程序时丢失了transpile步骤。