NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.58k stars 4.8k forks source link

npm run dev:h5编译失败 #951

Closed RubbbbbY closed 4 years ago

RubbbbbY commented 6 years ago

问题描述 [问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚] 已经重新cnpm i 过依赖了,还是报错 复现步骤 [复现问题的步骤]

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[或者可以直接贴源代码,能贴文字就不要截图]

// 这里可以贴代码

期望行为 [这里请用简洁清晰的语言描述你期望的行为]

报错信息

PS D:\testdemo\h5\taro-wycs> npm run dev:h5

taro-wycs@1.0.0 dev:h5 D:\testdemo\h5\taro-wycs npm run build:h5 -- --watch

taro-wycs@1.0.0 build:h5 D:\testdemo\h5\taro-wycs taro build --type h5 "--watch"

👽 Taro v1.0.7

开始编译项目 taro-wycs 创建 发现文件 src\app.js 创建 发现文件 src\app.scss 创建 发现文件 src\index.html 创建 发现文件 src\npm-debug.log 创建 发现文件 src\package.json 创建 发现文件 src\lib\recorder.js 创建 发现文件 src\node_modules.npminstall.done 创建 发现文件 src\node_modules\inline-worker fs.js:682 return binding.read(fd, buffer, offset, length, position); ^

Error: EISDIR: illegal operation on a directory, read at Object.fs.readSync (fs.js:682:18) at tryReadSync (fs.js:543:20) at Object.fs.readFileSync (fs.js:586:19) at processFiles (C:\node\node_modules\@tarojs\cli\src\h5.js:675:19) at Walker.klaw.on.file (C:\node\node_modules\@tarojs\cli\src\h5.js:740:11) at emitOne (events.js:115:13) at Walker.emit (events.js:210:7) at addChunk (_stream_readable.js:264:12) at readableAddChunk (_stream_readable.js:251:11) at Walker.Readable.push (_stream_readable.js:209:10)

npm ERR! Windows_NT 10.0.17134 npm ERR! argv "C:\node\node.exe" "C:\node\node_modules\npm\bin\npm-cli.js" "run" "build:h5" "--" "--watch" npm ERR! node v8.7.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! taro-wycs@1.0.0 build:h5: taro build --type h5 "--watch" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the taro-wycs@1.0.0 build:h5 script 'taro build --type h5 "--watch"'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the taro-wycs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! taro build --type h5 "--watch" npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs taro-wycs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls taro-wycs npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! D:\testdemo\h5\taro-wycs\npm-debug.log

npm ERR! Windows_NT 10.0.17134 npm ERR! argv "C:\node\node.exe" "C:\node\node_modules\npm\bin\npm-cli.js" "run" "dev:h5" npm ERR! node v8.7.0 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! taro-wycs@1.0.0 dev:h5: npm run build:h5 -- --watch npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the taro-wycs@1.0.0 dev:h5 script 'npm run build:h5 -- --watch'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the taro-wycs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run build:h5 -- --watch npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs taro-wycs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls taro-wycs npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! D:\testdemo\h5\taro-wycs\npm-debug.log

系统信息

补充信息 [可选] [根据你的调查研究,出现这个问题的原因可能在哪里?]

luckyadam commented 6 years ago

可以把 .temp 和 dist 目录删了再试

enjoyWeb commented 5 years ago

shop@1.0.0 build:h5 F:\www\front-mall taro build --type h5 "--watch"

👽 Taro v1.3.0

开始编译项目 shop 创建 发现文件 src\app.js 创建 发现文件 src\app.scss 创建 发现文件 src\index.html 创建 发现文件 src\api\index.js 创建 发现文件 src\api\userApi.js 创建 发现文件 src\store\index.js 创建 发现文件 src\store\user.js 创建 发现文件 src\utils\config.js 创建 发现文件 src\utils\const.js 创建 发现文件 src\utils\http.js 创建 发现文件 src\utils\utils.js 创建 发现文件 src\assets\images\logo.png 创建 发现文件 src\assets\style\iconfont.css 创建 发现文件 src\pages\home\index.js 创建 发现文件 src\pages\home\index.scss 创建 发现文件 src\pages\index\index.js 创建 发现文件 src\pages\index\index.scss

Error: listen EADDRINUSE: address already in use 0.0.0.0:10086 at Server.setupListenHandle [as _listen2] (net.js:1279:14) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) Emitted 'error' event at: at emitErrorNT (net.js:1306:8) at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! shop@1.0.0 build:h5: taro build --type h5 "--watch" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the shop@1.0.0 build:h5 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\ThinkPad\AppData\Roaming\npm-cache_logs\2019-07-10T01_24_48_296Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! shop@1.0.0 dev:h5: npm run build:h5 -- --watch npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the shop@1.0.0 dev:h5 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\ThinkPad\AppData\Roaming\npm-cache_logs\2019-07-10T01_24_48_362Z-debug.log

enjoyWeb commented 5 years ago

shop@1.0.0 build:h5 F:\www\front-mall taro build --type h5 "--watch"

👽 Taro v1.3.0

开始编译项目 shop 创建 发现文件 src\app.js 创建 发现文件 src\app.scss 创建 发现文件 src\index.html 创建 发现文件 src\api\index.js 创建 发现文件 src\api\userApi.js 创建 发现文件 src\store\index.js 创建 发现文件 src\store\user.js 创建 发现文件 src\utils\config.js 创建 发现文件 src\utils\const.js 创建 发现文件 src\utils\http.js 创建 发现文件 src\utils\utils.js 创建 发现文件 src\assets\images\logo.png 创建 发现文件 src\assets\style\iconfont.css 创建 发现文件 src\pages\home\index.js 创建 发现文件 src\pages\home\index.scss 创建 发现文件 src\pages\index\index.js 创建 发现文件 src\pages\index\index.scss

  • Compiling...events.js:174 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:10086 at Server.setupListenHandle [as _listen2] (net.js:1279:14) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) Emitted 'error' event at: at emitErrorNT (net.js:1306:8) at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! shop@1.0.0 build:h5: taro build --type h5 "--watch" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the shop@1.0.0 build:h5 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\ThinkPad\AppData\Roaming\npm-cache_logs\2019-07-10T01_24_48_296Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! shop@1.0.0 dev:h5: npm run build:h5 -- --watch npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the shop@1.0.0 dev:h5 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\ThinkPad\AppData\Roaming\npm-cache_logs\2019-07-10T01_24_48_362Z-debug.log

0 info it worked if it ends with ok 1 verbose cli [ 'F:\Program Files\nodejs\node.exe', 1 verbose cli 'F:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build:h5', 1 verbose cli '--', 1 verbose cli '--watch' ] 2 info using npm@6.9.0 3 info using node@v10.16.0 4 verbose run-script [ 'prebuild:h5', 'build:h5', 'postbuild:h5' ] 5 info lifecycle shop@1.0.0~prebuild:h5: shop@1.0.0 6 info lifecycle shop@1.0.0~build:h5: shop@1.0.0 7 verbose lifecycle shop@1.0.0~build:h5: unsafe-perm in lifecycle true 8 verbose lifecycle shop@1.0.0~build:h5: PATH: F:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\www\front-mall\node_modules.bin;F:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\www\front-mall\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;f:\Program Files\Git\cmd;F:\Program Files\TortoiseGit\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;F:\Program Files\nodejs\;C:\Users\ThinkPad\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\ThinkPad\AppData\Local\GitHubDesktop\bin;F:\Program Files\Microsoft VS Code\bin;f:\Program Files\Docker Toolbox;C:\Users\ThinkPad\AppData\Roaming\npm 9 verbose lifecycle shop@1.0.0~build:h5: CWD: F:\www\front-mall 10 silly lifecycle shop@1.0.0~build:h5: Args: [ '/d /s /c', 'taro build --type h5 "--watch"' ] 11 silly lifecycle shop@1.0.0~build:h5: Returned: code: 1 signal: null 12 info lifecycle shop@1.0.0~build:h5: Failed to exec build:h5 script 13 verbose stack Error: shop@1.0.0 build:h5: taro build --type h5 "--watch" 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (F:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:198:13) 13 verbose stack at ChildProcess. (F:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:198:13) 13 verbose stack at maybeClose (internal/child_process.js:982:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 14 verbose pkgid shop@1.0.0 15 verbose cwd F:\www\front-mall 16 verbose Windows_NT 10.0.17134 17 verbose argv "F:\Program Files\nodejs\node.exe" "F:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build:h5" "--" "--watch" 18 verbose node v10.16.0 19 verbose npm v6.9.0 20 error code ELIFECYCLE 21 error errno 1 22 error shop@1.0.0 build:h5: taro build --type h5 "--watch" 22 error Exit status 1 23 error Failed at the shop@1.0.0 build:h5 script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

huandie2012 commented 5 years ago

我在使用npm run build:h5编译的时候,并不会生成dist文件夹 Failed to compile.

Error: Child compilation failed: Entry module not found: Error: Can't resolve 'D:\project\mini-program\waste-sort\src\index.html' in 'D:\project\mini-program\waste-sort': Error: Can't resolve 'D:\project\mini-program\waste-sort\src\index.html' in 'D:\project\mini-program\waste-sort'

shenghanqin commented 4 years ago

@RubbbbbY 您好,升级到最新版本,还有这个问题吗?

taro-bot[bot] commented 4 years ago

CC @Littly

taro-bot[bot] commented 4 years ago

Hello~

您的问题所提供的信息不足,我们无法定位到具体的问题。如果有空的话还请拔冗提供更具体的信息,否则这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

beijipc commented 4 years ago

Error: listen EADDRINUSE: address already in use 0.0.0.0:10086

看到这一行,是不是你服务已经启了。10086端口已经被占用

Hecc1234 commented 6 months ago

我的报错 ERROR TypeError: Cannot convert undefined or null to object TypeError: Cannot convert undefined or null to object at Function.assign () at C:\Users\15274\Desktop\my-project\node_modules\@dcloudio\vue-cli-plugin-uni\lib\chain-webpack.js:53:34 at Object.tap (C:\Users\15274\Desktop\my-project\node_modules\webpack-chain\src\Use.js:14:20) at C:\Users\15274\Desktop\my-project\node_modules\@dcloudio\vue-cli-plugin-uni\lib\chain-webpack.js:53:12 at Array.forEach () at C:\Users\15274\Desktop\my-project\node_modules\@dcloudio\vue-cli-plugin-uni\lib\chain-webpack.js:22:17 at C:\Users\15274\Desktop\my-project\node_modules\@vue\cli-service\lib\Service.js:268:40 at Array.forEach () at Service.resolveChainableWebpackConfig (C:\Users\15274\Desktop\my-project\node_modules\@vue\cli-service\lib\Service.js:268:26) at Service.resolveWebpackConfig (C:\Users\15274\Desktop\my-project\node_modules\@vue\cli-service\lib\Service.js:272:48)
at PluginAPI.resolveWebpackConfig (C:\Users\15274\Desktop\my-project\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)
at serve (C:\Users\15274\Desktop\my-project\node_modules\@dcloudio\vue-cli-plugin-uni\commands\serve.js:51:31) at Service.run (C:\Users\15274\Desktop\my-project\node_modules\@vue\cli-service\lib\Service.js:262:12) at processTicksAndRejections (internal/process/task_queues.js:95:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! my-project@0.1.0 dev:h5: cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the my-project@0.1.0 dev:h5 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\15274\AppData\Roaming\npm-cache_logs\2024-05-09T05_25_17_384Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! my-project@0.1.0 serve: npm run dev:h5 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the my-project@0.1.0 serve 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\15274\AppData\Roaming\npm-cache_logs\2024-05-09T05_25_17_413Z-debug.log

enjoyWeb commented 6 months ago

╭(╯3╰)╮亲!你的信件我已经收到了,我会尽快查看的O(∩_∩)O哈!