我在使用snowpack.dev https://www.snowpack.dev/运行npm start时遇到此错误
[snowpack] ! updating dependencies...
[snowpack] ! installing dependencies…
[snowpack] Package "abstracts/variables" not found. Have you installed it?
[snowpack] Install failed.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `snowpack dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-09-15T12_18_05_035Z-debug.log
PS G:\antonio\projects\react\app>发布于 2021-02-02 07:03:50
您是否在tsconfig.json中使用baseUrl
如果要通过baseUrl配置将./src/abstracts作为abstracts/[whateverfile]导入,则需要在雪堆配置文件中设置别名(Docs here)。
snowpack.config.js (如果尚未创建)。将其放在应用程序的根目录中,靠近您的package.json.snowpack.config.js,添加:module.exports = {
...
alias: {
abstracts: '/src/abstracts',
// continue for remaining directories in /src
},
...
}https://stackoverflow.com/questions/63901843
复制相似问题