NPM运行开发。 ENOENT:没有这样的文件或目录

时间:2018-04-19 00:47:48

标签: npm webpack laravel-mix

完整错误

Error: ENOENT: no such file or directory, open '/home/Project/project/public/desktop/css/desktop.css'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at File.read (/home/Project/project/node_modules/laravel-mix/src/File.js:180:19)
at File.version (/home/Project/project/node_modules/laravel-mix/src/File.js:190:25)
at Manifest.hash (/home/Project/project/node_modules/laravel-mix/src/Manifest.js:55:65)
at manifest.forEach.file (/home/Project/project/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:79:47)
at Array.forEach (<anonymous>)
at CustomTasksPlugin.applyVersioning (/home/Project/project/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:79:18)
at Compiler.compiler.plugin.stats (/home/Project/project/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:12:22)
at Compiler.applyPlugins (/home/Project/project/node_modules/tapable/lib/Tapable.js:61:14)
at emitRecords.err (/home/Project/project/node_modules/webpack/lib/Compiler.js:264:11)
at Compiler.emitRecords (/home/Project/project/node_modules/webpack/lib/Compiler.js:371:38)
at emitAssets.err (/home/Project/project/node_modules/webpack/lib/Compiler.js:258:10)
at applyPluginsAsyncSeries1.err (/home/Project/project/node_modules/webpack/lib/Compiler.js:364:12)
at next (/home/Project/project/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/Project/project/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/Project/project/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/Project/project/node_modules/webpack/lib/Compiler.js:361:9)
at require.forEach.err (/home/Project/project/node_modules/webpack/lib/Compiler.js:350:15)
at /home/Project/project/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/Project/project/node_modules/async/dist/async.js:1050:13)
at /home/Project/project/node_modules/async/dist/async.js:958:16
at /home/Project/project/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:135:15)

Pagkage.json

"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

我的webpack.config.js

sass('resources/assets/sass/desktop.scss', 'public/css/desktop')
copy('public/css/desktop/desktop.css', 'desktop/css/desktop.css', false)

该文件夹不存在,但我没有任何命令查找该特定文件夹

非常感谢任何帮助!谢谢!

1 个答案:

答案 0 :(得分:1)

固定。只需要按照路径组合寻找。

更改了我的webpack.mix.js

sass('resources/assets/sass/desktop.scss', 'public/desktop/css/')
copy('public/desktop/css/desktop.css', 'desktop/css/desktop.css', false)