环境
win10
node v14.16.0
npm v6.14.11
vite 1.0.0-rc.13
步骤
$ npm init vite-app tmp
$ npm install
$ npm install sass
$ npm run dev
报错信息
[vite] Dep optimization failed with error:
Could not load readline (imported by node_modules\sass\sass.dart.js): ENOENT: no such file or directory, open 'D:\Code\NewIdea\tmp\tmp\readline'
[Error: Could not load readline (imported by node_modules\sass\sass.dart.js): ENOENT: no such file or directory, open 'D:\Code\NewIdea\tmp\tmp\readline'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'D:\\Code\\NewIdea\\tmp\\tmp\\readline',
watchFiles: [
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\sass\\sass.dart.js',
'\x00commonjsHelpers.js',
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\vue\\dist\\vue.runtime.esm-bundler.js',
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\@vue\\runtime-dom\\dist\\runtime-dom.esm-bundler.js',
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\@vue\\runtime-core\\dist\\runtime-core.esm-bundler.js',
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\@vue\\shared\\dist\\shared.esm-bundler.js',
'D:\\Code\\NewIdea\\tmp\\tmp\\node_modules\\@vue\\reactivity\\dist\\reactivity.esm-bundler.js',
'readline',
'\x00readline?commonjs-proxy',
'\x00fs?commonjs-proxy',
'fs'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tmp@0.0.0 dev: `vite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tmp@0.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
前几天是还能运行的,这两天就运行npm run dev
就出错,不知道为什么
npm install sass -D
sass装到devDependencies 下