Npm run sls multi offline keeps getting terminated - node.js

I'm trying to run npm run sls-multi-offline (I have "start": "sls-multi-offline" in package.json file) but it keeps getting terminated without giving any error message or warning other than exited with code 0. This is what it looks like:
> start
> sls-multi-offline
[HPM] Proxy created: / -> http://localhost:3100/dev/
[HPM] Proxy created: / -> http://localhost:3101/dev/
[auth]
[auth] cd C:\Users\HP\Desktop\coreservices/./services/auth;
[auth] npx sls offline --stage dev --httpPort 3101 --lambdaPort 4101
[auth] exited with code 0
--> Sending SIGTERM to other processes..
[accounts]
[accounts] cd C:\Users\HP\Desktop\coreservices/./services/accounts;
[accounts] npx sls offline --stage dev --httpPort 3100 --lambdaPort 4100
[accounts] exited with code 0
PS C:\Users\HP\Desktop\coreservices>
What could be causing this?

Related

ts-node permission denied in Docker

Running Express js server with pnpm in container gives permission error during start like this:
> pnpm run --filter=#workspace/mypackage dev
> #workspace/mypackage#1.0.0 dev /app/packages/mypackage
> nodemon
[nodemon] 2.0.20
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts
[nodemon] starting `ts-node ./src/index.ts`
sh: ts-node: Permission denied
[nodemon] app crashed - waiting for file changes before starting...
pnpm unsafe-perm is already set true and corepack enabled.
My package json looks like this:
...
"scripts": {
"dev": "nodemon"
},
...
"dependencies": {
"express": "^4.18.2"
},
"devDependencies": {
"nodemon": "^2.0.20",
"ts-node": "^10.9.1"
}
Update: just found that ts-node is not installed during build by testing ts-node in the last step of docker build. So the problem turns out to be why pnpm didn't install dev dependency of a package which is ts-node.
Docker build logs:
#14 [stage-1 7/8] RUN ts-node -e 'console.log("Hello, world!")'
#14 sha256:e75e2e17e660efaa7407c1bbeaf48e9d7d4ac754facc168f35cdd1f51ff00b91
#14 0.346 /bin/sh: ts-node: not found
#14 ERROR: executor failed running [/bin/sh -c ts-node -e 'console.log("Hello, world!")']: exit code: 127
------
> [stage-1 7/8] RUN ts-node -e 'console.log("Hello, world!")':
------
executor failed running [/bin/sh -c ts-node -e 'console.log("Hello, world!")']: exit code: 127

Assertion failed: new_time >= loop->time, file c:\ws\deps\uv\src\win\core.c, line 324

PS C:\xampp\htdocs\website> node -v
v18.12.1
PS C:\xampp\htdocs\website> npm -v
8.19.2
PS C:\xampp\htdocs\website> npm run dev
> dev
> vite
VITE v3.2.5 ready in 1227 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
LARAVEL v9.43.0 plugin v0.7.2
➜ APP_URL: http://localhost
Assertion failed: new_time >= loop->time, file c:\ws\deps\uv\src\win\core.c, line 324
PS C:\xampp\htdocs\website> npm run dev
> dev
> vite
Assertion failed: new_time >= loop->time, file c:\ws\deps\uv\src\win\core.c, line 324
I am running vite for laravel.
It works for a while.
After a few minutes it says :Assertion failed
and I run "npm run dev" again
it's the same error
edit:
Currently my solution is
Replace Vite with Mix in Laravel 9.4

React App failed to compile after install

After running the install script, the server starts and serves a page displaying the same text after the 'Failed to compile line.'
I'm running Windows 10 and auto update just updated my pc today, right before I did the create-react-express install.
PS H:\mern-passport> npm start
> mern#1.0.0 start H:\mern-passport
> if-env NODE_ENV=production && npm run start:prod || npm run start:dev
> mern#1.0.0 start:dev H:\mern-passport
> concurrently "nodemon --ignore 'client/*'" "npm run client"
[0] [nodemon] 1.19.4
[0] [nodemon] to restart at any time, enter `rs`
[0] [nodemon] watching dir(s): *.*
[0] [nodemon] watching extensions: js,mjs,json
[0] [nodemon] starting `node server.js`
[0] API server now on port 3001!
[1]
[1] > mern#1.0.0 client H:\mern-passport
[1] > cd client && npm run start
[1]
[1]
[1] > mern#0.1.0 start H:\mern-passport\client
[1] > react-scripts start
[1]
[1] Starting the development server...
[1]
[1] Failed to compile.
[1]
[1] ./src/index.css (./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
[1] Error: Package exports for 'H:\mern-passport\client\node_modules\autoprefixer\node_modules\kleur' do not define a valid './colors' target
[0] Error: ENOENT: no such file or directory, stat 'H:\mern-passport\client\build\index.html'
[0] Error: ENOENT: no such file or directory, stat 'H:\mern-passport\client\build\index.html'
Seems to be an issue with autoprefixer latest version. I referred https://github.com/postcss/autoprefixer/issues/1328 and tried downgrading autoprefixer in my project and it works now.
Try:
npm install autoprefixer#9.8.0
Happy coding!
I also faced this problem. And it looks like a problem with autoprefixer version, so i changed the version.
npm install autoprefixer#9.8.0
I tried this, and it works perfectly.
I was running into this issue too. I installed yarn and created a new project with the npx create-react-app command and this fixed the issue.

node.js & react - server not up, from github project

I found one project on GitHub darkwire and wanted to install it and play with it. Firstly I tried to install it from windows. I installed Node.js and Yarn and I got errors with the command: yarn dev
`C:\darkwire.io-master>yarn dev
yarn run v1.21.1
$ concurrently 'cd client && yarn start' 'cd server && yarn dev'
[0] 'c' is not recognized as an internal or external command,
[0] operable program or batch file.
[1] 'client' is not recognized as an internal or external command,
[1] operable program or batch file.
[0] c exited with code 1
[1] client exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
My next step was to try it in ubuntu 19.10, firstly I installed again Node.js and Yarn and again used: yarn dev. I got an error but now was open site and it not working, just say "Disconnected"
```qq#ubuntu:~/Downloads/darkwire.io-master$ yarn dev
yarn run v1.21.1
$ concurrently 'cd client && yarn start' 'cd server && yarn dev'
$ nodemon src/index.js --exec babel-node
$ react-scripts start
[1] [nodemon] 1.19.0
[1] [nodemon] to restart at any time, enter `rs`
[1] [nodemon] watching: *.*
[1] [nodemon] starting `babel-node src/index.js`
[1] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[1] Checking for inactive rooms...
[1] Darkwire is online at port 3001
[1] events.js:183
[1] throw er; // Unhandled 'error' event
[1] ^
[1]
[1] Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
[1] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
[1] [nodemon] app crashed - waiting for file changes before starting...
[0] Starting the development server...
[0]
[0] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[0] Compiled successfully!
[0]
[0] You can now view darkwire-client in the browser.
[0]
[0] Local: http://localhost:3000/
[0] On Your Network: http://175.124.13.111:3000/
[0]
[0] Note that the development build is not optimized.
[0] To create a production build, use yarn build.
[0]
```
screenshot
I think maybe I have the wrong version Node.js and try install 9.x version, download again project and try again, it not help, try change port from 3001 to 3000, not help.
From their README.md
Darkwire Server
Darkwire server is a Node.js application that requires redis.
So please install a compatible redis server. Redis tutorial

Bluemix push error

i'm getting an error when I try to push to BlueMix from local.
> node lib/install.js
> optipng-bin#3.1.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-optipng/node_modules/optipng-bin
✔ optipng pre-build test passed successfully
> pngquant-bin#3.1.1 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node lib/install.js
✔ pngquant pre-build test passed successfully
> gifsicle#3.0.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-gifsicle/node_modules/gifsicle
> node lib/install.js
✔ gifsicle pre-build test passed successfully
/tmp/buildpacks/cbed2b9b0603a1febfaafeebb556dd0b/lib/dependencies.sh: line 1: 163 Killed npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
-----> Build failed
Failed to compile droplet
Check our support community to get help on common issues:
http://ibm.biz/bluemixcommunitysupport
If you need additional help and your subscription includes support, submit a ticket so we can help:
http://ibm.biz/bluemixsupport
Exit status 223
Staging failed: Exited with status 223 (out of memory)
Destroying container
Successfully destroyed container
FAILED
Error restarting application: StagingError
It works great locally. I tried increasing memory to 1GB, didn't help either. Please help.

Resources