Problem running Plutus Playground Client on MacOS - haskell

I am encountering a problem when trying to run the Plutus Playground through Nix on MacOS.
I tried using the last available tag v2021-12-20, but I am getting the following error when I try to run the Plutus Playground Client in nix-shell:
nix-shell:~/cardano/plutus-apps/plutus-playground-client]$ npm run start
> plutus-playground-client#1.0.0 start /Users/matt/cardano/plutus-apps/plutus-playground-client
> plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev
/nix/store/2nr8xfy3zqdgxfmxlc3r48gijfdwbnrf-plutus-playground-generate-purs/bin/plutus-playground-generate-purs: line 6: /bin/plutus-playground-server: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! plutus-playground-client#1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the plutus-playground-client#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! /Users/matt/.npm/_logs/2021-12-20T18_27_49_943Z-debug.log
It seems similar to Plutus Playground Client cannot run, but I couldn't find anything to help run it.
My Nix config:
uild-users-group = nixbld
substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
sandbox = false
system = x86_64-darwin
extra-platforms = x86_64-darwin aarch64-darwin
I am running it on an M1 Mac.

Related

Nestjs failed to deploy on cpanel

I'm trying to deploy my backend application on cpanel and I'm getting an error like this
what should i do to solve this problem?
> test3#0.0.1 start /home/nandaken/inventory
> nest start
stderr:
npm WARN lifecycle The node binary used for scripts is /home/nandaken/nodevenv/inventory/12/bin/node but npm is using /opt/alt/alt-nodejs12/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: nest: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test3#0.0.1 start: `nest start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test3#0.0.1 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! /home/nandaken/.npm/_logs/2023-01-28T08_16_43_494Z-debug.log
Looks like cpanel is calling the startscript which is running nest start. More than likely, you only have production dependencies installed, so #nestjs/cli isn't installed because it is a devDependency. Either configure cpanel to call a different start script (like start:prod which should map to node dist/main) or change your start script to run the proper js file (like node dist/main). The other option would be to install #nestjs/cli as a production dependency, but I wouldn't suggest that

NextJS not running on MacOS even after installing modules

So I've just created a NextJS project using create-next-app which went smoothly as expected. Then ran npm i just to be sure and saw all modules installed into node_modules
When I try to run npm run dev to start my nextjs app. it just says
sh: next: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test#0.1.0 dev: `next dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test#0.1.0 dev 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! /Users/john.v.n.pakson/.npm/_logs/2022-10-06T08_01_29_725Z-debug.log
It seems like npm is not detecting the node_modules i have installed.
Not sure if this is a mac or a zsh issue.
I'm using node version 12.22.12
Upgraded to 16.17.1 and still see the same error
> test#0.1.0 dev
> next dev
/var/folders/6y/xtlzp4z16dj0stxnqx8znj8w0000gn/T/dev-01c08137.sh: line 1: next: command not found
Okay I figured it out. It was caused by my file path on macos. My project was on a folder called Project/Test which might have confused zsh or mac. This in turn caused npm to not be able to find the correct scripts on my node_modules
When I moved my project to another folder I was already able to run npm run dev properly.
Cheers!

I've this problem when I start npm: npm ERR! code ELIFECYCLE

when I do npm start it gaves me this error (it's Italian but you can use google translate):
npm start
> codeeditor#1.0.0 start D:\CodeEditor
> electron .
"electron" non ▒ riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! codeeditor#1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the codeeditor#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Giovanni\AppData\Roaming\npm-cache\_logs\2020-05-22T14_13_45_030Z-debug.log
thank you for help ;)
First use npm init to initialize package.json .Then use npm i electron for installing electron. Then try npm start.
Simplest the answer,
Install electron first and then run.
npm install electron
Also make sure you're not using gitbash for running the npm run.

Parcel command not found

In my project, I use Parcel to bundle everything. Now, I am at the point where I need to deploy my app.
I clone my git repo with my React app and I put in the Node server.
I tried every command possible to install parcel, but I always get the following error :
> pp-react#0.1.0 build /home/volodymk/react
> parcel build index.html
sh: parcel: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! pp-react#0.1.0 build: `parcel build index.html`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pp-react#0.1.0 build 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/volodymk/.npm/_logs/2020-01-12T19_26_22_634Z-debug.log
How can I fix this ?
To run any installed node package (not just Parcel), use npx, the utility command shipped with npm. It executes packages that come with a runtime command in your node_modules/packagename/.bin directories.
As in npx parcel build index.html
More information available in the npx readme.

npm run cmd fails while cmd on command line works

In my HTTP Status Check project:
If I run node_modules/.bin/jshint . I get:
$ node_modules/.bin/jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
It executes correctly and produces the expected output: 1 error.
But if I add that command to package.json and try and run it through npm run then it works and produces the expected output but also follows that with a bunch of errors:
$ npm run jshint
> http-status-check#0.0.5 jshint /home/guy/source/http-status-check
> jshint .
test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon.
1 error
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/home/guy/local/bin/npm" "run" "jshint"
npm ERR! node v0.10.31
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! http-status-check#0.0.5 jshint: `jshint .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the http-status-check#0.0.5 jshint script.
npm ERR! This is most likely a problem with the http-status-check package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! jshint .
npm ERR! You can get their info via:
npm ERR! npm owner ls http-status-check
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/guy/source/http-status-check/npm-debug.log
This is how it's defined in package.json:
"scripts": {
"jshint": "node_modules/.bin/jshint .",
},
What have I done wrong?
Don't exit with a non-zero error code unless you really mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
From https://www.npmjs.org/doc/misc/npm-scripts.html
Use:
node_modules/.bin/jshint .; true
Or write a wrapper that calls jshint and then ignores the exit code and exits successfully with a exit code of zero.

Resources