I am implementing react app.
My environment is in intranet with no internet access.
So, I set react project in outside environment with internet access.
After copying project to intranet environment, I executed npm install and start.
But a error has occurred during starting below.
PS D:\workspaces\my-app> npm start
> my-app#0.1.0 start D:\workspaces\my-app
> react-scripts start
i 「wds」: Project is running at http://10.225.168.119/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from D:\workspaces\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 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\KTDS\AppData\Roaming\npm-cache\_logs\2020-07-02T02_03_07_566Z-debug.log
This project is working fine in outside env.
Is the solution to this issue?
Related
Please could I ask for help with the following:
I have cloned the Electron starter app like so:
git clone https://github.com/electron/electron-quick-start
And have it running.
I am working from the terminal window is VSCode.
I am using node version 6.13.4
Can type "npm start" and all is good, app runs fine.
Now, I want to use a certain package for working with zip files, so I try the following:
npm install decompress-zip
The result is ultimately an error, here's the output:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm install decompress-zip
> electron#16.0.5 postinstall C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\electron
> node install.js
RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:428:26)
at ClientRequest.emit (events.js:333:22)
at ClientRequest.origin.emit (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:321:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm WARN rollback Rolling back debug#2.6.9 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\extract-zip\node_modules'npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#16.0.5 postinstall 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\105043131\AppData\Roaming\npm-cache\_logs\2022-01-05T11_15_47_499Z-debug.log
Now the build is broken. If try again "npm start" then I get:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm
start
electron-quick-start#1.0.0 start C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip
electron .
internal/modules/cjs/loader.js:984 throw err; ^
Error: Cannot find module 'C:\Work\Electron
Apps\electron-quick-start-added-fs-and-zip\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm
ERR! errno 1 npm ERR! electron-quick-start#1.0.0 start: electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
electron-quick-start#1.0.0 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\105043131\AppData\Roaming\npm-cache_logs\2022-01-05T11_18_31_473Z-debug.log
Makes no difference now if I run "npm uninstall decompress-zip", I still get the same error when I try "npm start".
This line from the above caught my eye:
npm ERR! Failed at the electron#16.0.5
If I start completely over an try installing another package instead like so:
npm install yauzl
I get similar errors including the line:
npm ERR! Failed at the electron#16.0.5 postinstall script.
I currently have electron 8.1.1 installed
Could it be that these packages require electron 16?
Or is it something else?
If it is the former, would anyone know of a solution for unzipping a disk file using an older version of electron?
Thanks for any help.
the best way is to update Node.js. Uninstall old version then go to https://nodejs.org/en/download/ and download LTC version
When I run yarn dev I get the following output:
yarn run v1.22.10
warning package.json: No license field
$ vite
🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀
⚡️⚡️ Hello RSW! ⚡️⚡️
⚡️⚡️ Vite + Rust 💖 WebAssembly ⚡️⚡️
🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀
vite-plugin-rsw (1.8.0)
[rsw::deploy] https://github.com/lencx/rsw-node
[rsw::optimized] wasm-pack build wasm.
up to date, audited 241 packages in 3s
7 packages are looking for funding
run `npm fund` for details
4 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../../../home/isaachmi/projects/my-blackspace/wasm/pkg
npm ERR! dest /usr/lib/node_modules/wasm
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../../../home/isaachmi/projects/my-blackspace/wasm/pkg' -> '/usr/lib/node_modules/wasm'
npm ERR! [Error: EACCES: permission denied, symlink '../../../home/isaachmi/projects/my-blackspace/wasm/pkg' -> '/usr/lib/node_modules/wasm'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../../../home/isaachmi/projects/my-blackspace/wasm/pkg',
npm ERR! dest: '/usr/lib/node_modules/wasm'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/isaachmi/.npm/_logs/2021-07-21T14_44_01_966Z-debug.log
[rsw::npm::link]
↳ wasm /home/isaachmi/projects/my-blackspace/wasm/pkg
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:
wasm (imported by /home/isaachmi/projects/my-blackspace/src/components/HelloWorld.vue)
Are they installed?
at optimizeDeps (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73091:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOptimize (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73765:48)
at async Server.httpServer.listen (/home/isaachmi/projects/my-blackspace/node_modules/vite/dist/node/chunks/dep-f2b4ca46.js:73779:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My WebAssembly package is called wasm and this is my vite configuration:
import { defineConfig } from "vite";
import vue from "#vitejs/plugin-vue";
import ViteRsw from "vite-plugin-rsw";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
ViteRsw({
crates: ["wasm"],
}),
],
});
I'm using a plugin for vite to use Rust and WebAssembly. I followed the example that they have with Vue3 but using my package. Am I doing something wrong?
I have tried to install electronjs several times but I have not been able, I am behind a proxy and each attempt has returned the following error
> electron#10.1.5 postinstall /home/dipper/Development/my-electron-app/node_modules/electron
> node install.js
RequestError: getaddrinfo EAI_AGAIN github.com github.com:443
at ClientRequest.request.once.error (/home/dipper/Development/my-electron-app/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:286:20)
at ClientRequest.emit (events.js:203:15)
at ClientRequest.origin.emit.args (/home/dipper/Development/my-electron-app/node_modules/#szmarczak/http-timer/source/index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm WARN enoent ENOENT: no such file or directory, open '/home/dipper/Development/my-electron-app/package.json'
npm WARN my-electron-app No description
npm WARN my-electron-app No repository field.
npm WARN my-electron-app No README data
npm WARN my-electron-app No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#10.1.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#10.1.5 postinstall 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! /home/dipper/.npm/_logs/2020-11-10T17_15_33_463Z-debug.log
Try this command:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=<your proxy URL> npm install electron
Check this thread for more information and the original source.
I solved the problem by changing the connected wifi network. I shared the mobile data with my computer and "npm i electron" worked.
I am installing Yeoman on my machine and ran this
npm install -g yo
This is giving me permission error:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/siddharth/.npm/_logs/2020-04-24T22_31_29_025Z-debug.log
But this got resolved by attaching sudo
Now I am getting this error:
Yeoman Doctor
Running sanity checks on your system
✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
path: 'yo',
spawnargs: [ '--version' ],
cmd: 'yo --version'
}
✖ yo version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
path: 'yo',
spawnargs: [ '--version' ],
cmd: 'yo --version'
}
Found potential issues on your machine :(
+ yo#3.1.1
updated 1 package in 29.492s
Running yo --version is giving zsh: command not found: yo
I tried this https://stackoverflow.com/a/58277450/10309895 but this is also not working for me
:,(
I stumbled over this discussion:
https://github.com/nodejs/node/issues/3675
when googling this error:
{ Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'root', '-g' ] }
but I dont know how to access this npm.cmd. I was on their site https://www.npmjs.com/package/node-cmd
and I installed it with npm install node-cmd
but Im pretty clueless how to run it, Im getting errors like this when typing
npm run node-cmd
npm ERR! path D:\nodeJS\node-v10.16.0-win-x64\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\nodeJS\node-v10.16.0-win-x64\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
Basically, I want to run this node-cmd inside my project so I can (hopefully) execute:
npx webpack-cli init
successfully
if you're running under win32 try for example:
When installing packages
npm.cmd install
or Run npm scripts syncrhonously
npm.cmd run sync -- --init