Issue with node while building svelte application in cloudflare pages - node.js

When I try and deploy my svelte project in Cloudflare pages I get this error
22:58:31.466 Cloning repository...
22:58:32.245 From https://github.com/ehubbartt/ethanhub
22:58:32.245 * branch 7807b7d14bc466249b9955d9ef06431003cd53ac -> FETCH_HEAD
22:58:32.246
22:58:32.295 HEAD is now at 7807b7d sdfs
22:58:32.295
22:58:32.438
22:58:32.464 Success: Finished cloning repository files
22:58:33.142 Installing dependencies
22:58:33.155 Python version set to 2.7
22:58:35.570 Attempting node version 'NODE_VERSION=12.18.0' from .nvmrc
22:58:37.196 Version 'NODE_VERSION=12.18.0' not found - try nvm ls-remote to browse available versions.
22:58:37.199 Failed to install node version 'NODE_VERSION=12.18.0'
22:58:37.204 Failed: build command exited with code: 1
22:58:38.110 Failed: an internal error occurred
Here is whay my .nvmrc file contains
NODE_VERSION=12.18.0
And I also have the environment variable set for the page.
NODE_VERSION=12.18.0
I have tried setting the version to many different things but can't quite get it to work and build

Related

failed to compile testmain package - compile, no such file

I'm new to Go programming and trying to set up the BDD framework Godog. I have extracted the Linux binary from the Github releases page and placed it on my $PATH. When I run it, I get the following error:
Error: failed to compile testmain package: fork/exec /opt/hostedtoolcache/go/1.17.7/x64/pkg/tool/linux_amd64/compile: no such file or directory - output:
For some reason godog version does not show an actual version, which leads me to believe it's not installed correctly.
❯ godog version
Show current version
Additional system information:
❯ go version
go version go1.18.3 linux/amd64
I don't know if this is relevant, but I'm using asdf to manage my local go installation.

failed to load next.config.js when building using github action

I am using simple ssh deploy action and i have a bash script to build and restart pm2 frontend process.
It's working fine when I run it directly run the script through the ec2 instance but gives error when building through the github action
below is the generated error
It says Failed to load next.config.js but its there, I've printed out pwd to make sure its the correcy directory. But still the same error
Node -> 14.17.0
Next -> 12.0.8
npm -> 6.14.3
out: /home/***/elfswap/elfswap-frontend
out:
out: > fe-elf# build /home/***/elfswap/elfswap-frontend
out: > next build
out:
err: error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
err:
err: > Build error occurred
err: Error: Not supported
err: at Object.loadConfig [as default] (/home/***/elfswap/elfswap-frontend/node_modules/next/dist/server/config.js:413:78)
#!/bin/bash
cd /home/ubuntu/project/frontend
git pull origin master
echo "$(pwd)"
npm run build
pm2 restart frontend
Looking back at it with a fresh mind, figured out the problem.
I already knew that remote ssh doesn't load the bash profile, but node command was working fine so i didn't look much further.
but after echoing node version in the bash script, found out it was using version 8.. from /usr/local/bin not the one installed through nvm.
So to make it work, I removed npm, node binaries from /usr/local/bin and replaced those with symbolic links from nvm version directory.
Now its working fine.

ReactOnRails pre-rendering error after deploying web app with new Ruby and Node versions with Capistrano

Background of the problem
My website is a Rails webapp running the Sharetribe open source code, with Puma & React on Rails to pre-render components. It has a TopBarApp component built by Sharetribe that displays top menus like Home, About, etc.
We recently upgraded the Ruby version from 2.6.2p47 to 2.6.5p114, and Node v7.8.0 to v10.15.3 (npm v6.4.1). After redeploying the new code with Capistrano, theTopbar no longer displays, and we can't access many subpages in our website. We get error msg:
Error during failsafe response: ERROR in SERVER PRERENDERING when prerendering TopbarApp with props
(Full Puma error log | Full Puma access log)
This bug is generated when running the step deploy:assets:precompile with Capistrano deployment. I think have an issue when we build the code client for javascript (css files). Maybe it is not related to Ruby or Node version but something to do with memory when we build.
Checking Chrome developer console gives TypeError: s is not a function
What I have tried
I tried to remove select nvm when Capistrano deploy. My commit:
However, the error is still there because SSH must set npm and node versions.
Any ideas?

Getting error when deploying a Google Cloud Function after Node upgrade

I updated Brew then updated Node from 10.12.0 -> 13.8.0
Now, I get the following error when trying to deploy a Google Cloud Function
firebase deploy --only functions:createJWT
i functions: preparing functions directory for
uploading...
Error: Error parsing triggers: Failed to load gRPC binary module
because it was not installed for the current system Expected
directory: node-v79-darwin-x64-unknown Found:
[node-v64-darwin-x64-unknown] This problem can often be fixed by
running "npm rebuild" on the current system Original error: Cannot
find module
'/Users/.../cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node'
Require stack:
- /Users/.../cloud-functions/functions/node_modules/grpc/src/grpc_extension.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client_interceptors.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client.js
- /Users/.../cloud-functions/functions/node_modules/grpc/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/service.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/operation.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/logging/src/index.js
- /Users/.../cloud-functions/functions/index.js
- /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js
Try running "npm install" in your functions directory before
deploying.
Tried npm rebuild and npm install in my functions directory and nothing works
Furthermore...could this issue be due to the fact that GCF Node runtime enviroment is Node10 and I have installed Node13 on my machine? - according to these docs:
https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime
I am struggling to revert back to Node10, have tried by running brew install node#10 and get this:
Then tried running the following command as per output above to symlink it to /usr/local but still no luck
echo 'export PATH="/usr/local/opt/node#10/bin:$PATH"' >> ~/.bash_profile
Searching around about this error, indeed, this seems that the problem is related to your system waiting for a version and founding another one - as per this part of the error.
Error: Error parsing triggers: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v79-darwin-x64-unknown Found: [node-v64-darwin-x64-unknown]
There are some options that you can give it a try, besides trying the npm rebuild. Another option might be updating the package.json - as per this case solved here - that would return your npm version to an old one.
Besides that, on this question in the Community, there are a few solutions that helped other users, that I would recommend you to take a look at it: NodeJs Error - Failed to load gRPC binary module because it was not installed for the current system Expected directory?
Let me know if the information helped you!
Trying to deploy to an unsupported Google Function execution environment won't work. According to the google docs the current supported environments are Node8 and Node10(beta), re-installing Node10 worked for me.

Error in installing/ running serialport in node.js

Have been trying to installing/ running 'serialport' on Node.js but it fails.
First I tried installing the current version 0.7.3 and it fails with the following errors
Waf: Leaving directory `/home/anand/node/node_modules/serialport/serialport_native/build'
'build' finished successfully (0.237s)
cp: cannot stat `build/Release/serialport_native.node': No such file or directory
Next I tried installing version 0.6.7. It installs correctly but when I try to run the examples I get the following error
Error: Unable to load shared library /home/anand/node/node_modules/serialport/serialport_native.node
I have checked that the library exists and has read/write/execute permissions.
I have also checked with different versions of Node including 0.6.4, 0.6.10

Resources