I have a basic custom js GitHub action which is executing a fetch call to an API. However, I'm getting a MODULE_NOT_FOUND error. I've tried different versions of node-fetch etc but haven't been able resolve the error. Has anyone encountered this error? And if so do you know how to resolve?
My Action repository is https://github.com/ReleaseNotesHub/GitHubPullAction
Error
Error: Cannot find module '/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/is-plain-object/dist/is-plain-object.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:297:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:528:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:784:27)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/#octokit/endpoint/dist-node/index.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32) {
code: 'MODULE_NOT_FOUND',
path: '/home/runner/work/GitHubPullAction/GitHubPullAction/node_modules/is-plain-object/package.json',
requestPath: 'is-plain-object'
}
The file node_modules/is-plain-object/dist/is-plain-object.js (which it's looking for) is not in your git repo. It's in your local client, but git add . is ignoring it because dist/ is in your .gitignore. This is a very default setup, but it breaks github actions.
Related
I am getting the following error while running serverless offline start
Can someone help me with this?
offline: POST /dev/trader/create (λ: CreateTrader)
offline: Failure: package.json does not exist at /home/denzilgupta/serverless-testing/.webpack/service/services/trader/package.json
Error: package.json does not exist at /home/denzilgupta/serverless-testing/.webpack/service/services/trader/package.json
at Object.../../node-pre-gyp/lib/pre-binding.js.exports.find (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/webpack:/home/denzilgupta/serverless-testing/node_modules/node-pre-gyp/lib/pre-binding.js:18:1)
at Object.../../bcrypt/bcrypt.js (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/webpack:/home/denzilgupta/serverless-testing/node_modules/bcrypt/bcrypt.js:5:1)
at webpack_require (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/webpack:/webpack/bootstrap:19:1)
at Module.../../../services/trader/handler.js (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/handler.js:164:64)
at webpack_require (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/webpack:/webpack/bootstrap:19:1)
at /home/denzilgupta/serverless-testing/.webpack/service/services/trader/webpack:/webpack/bootstrap:83:1
at Object. (/home/denzilgupta/serverless-testing/.webpack/service/services/trader/handler.js:87:10)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /home/denzilgupta/serverless-testing/node_modules/serverless-offline/dist/lambda/handler-runner/in-process-runner/InProcessRunner.js:67:133
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at InProcessRunner.run (/home/denzilgupta/serverless-testing/node_modules/serverless-offline/dist/lambda/handler-runner/in-process-runner/InProcessRunner.js:67:9)
Looks like bcrypt work as a native module for nodeJS, probably it contains some DLL and/or binaries. To load this kind of module nodeJS needs the full path to the lib, it does not work well with module bundlers like webpack. It would work as an external plugin but it seems that it does not attend your use case as you are using serverless framework and need to bundle everything together.
I suggest changing to bcryptjs, it is 30% slower because of the implementation in JS instead of using C++ but it works with webpack.
I'm trying to deploy the Google Assisant SDK in Node.js to a Google Cloud Function but running into this error..
Deployment failure:
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-linux-x64-glibc
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 '/srv/google-assistant-grpc/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node'
at Object.<anonymous> (/srv/google-assistant-grpc/node_modules/grpc/src/grpc_extension.js:53:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/google-assistant-grpc/node_modules/grpc/src/client_interceptors.js:144:12)
at Module._compile (module.js:653:30
From searching online, it looks like I need to rebuild with a specific binary. So in my package.json I added this, but that doesn't seem to have done anything. To deploy I'm simply zipping everything up and uploading it to the Google Cloud Function interface. Any ideas?
"scripts": {
"postinstall": "npm rebuild --target=8.1.0 --target_platform=linux --target_arch=x64 --target_libc=glibc --update-binary"
}
All of a sudden, I'm getting this while trying to run ionic. What's wrong?
My Laptop Suddenly Crashes and when I restarted my System and Open Ionic in Code Editor it shows the Following Error:
Unable to parse Ionic Config file. Please make sure it is valid JSON (.ionic/ionic.config)
Caught exception:
SyntaxError: Unexpected token
at Object.parse (native)
at Object.module.exports.load (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\lib\config.js:14:26)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\utils\stats.js:31:31)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\BBytes\AppData\Roaming\npm\node_modules\ionic\lib\cli.js:3:18)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
After Some trial and Error:
I think I have found the source of my problem!
My C:/Users/{username}/.ionic/ionic.config file was corrupted when my pc crashed /or due to some other error.
Weird that that file NEVER gets cleared when uninstalling ionic.
Just Delete the file and when you run ionic serve it will create the file by default in the folder.
I get an error while installing React-native, I have tried to search for an answer, but I can not find one.
When running "react-native init meet" I get this error:
This will walk you through creating a new React Native project in /Users/alfred/React/meet
Installing react-native package from npm...
Setting up new React Native app in /Users/alfred/React/meet
module.js:338
throw err;
^
Error: Cannot find module './src/init'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/alfred/React/meet/node_modules/react-native/node_modules/yeoman-generator/node_modules/download/node_modules/vinyl-fs/node_modules/gulp-sourcemaps/index.js:4:9)
at Module._compile (module.js:434:26)
at Module._extensions..js (module.js:452:10)
at Object.require.extensions.(anonymous function) [as .js] (/Users/alfred/React/meet/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
I don't really get what is wrong...
It's related to an issue with gulp-sourcemaps recent deployment https://github.com/floridoo/gulp-sourcemaps/issues/238
A project maintainer says at the end of the thread that he'll get to it today and
For the time being lock your version down to 2.0.x or 1.7.x
To fix, add specific version in your package.json until the issue is fixed:
{
"devDependencies": {
"gulp-sourcemaps": "1.7.x"
}
}
Use npm shrinkwrap to prevent similar issues in the future.
This is caused by a recent change in gulp-sourcemaps. See bug here: https://github.com/floridoo/gulp-sourcemaps/issues/238
This is now fixed. Run npm install
https://github.com/floridoo/gulp-sourcemaps/issues/238
How do I install JSON support in Visual Studio 2015?
I saw a video by Satchin about how to prepare my PC, and installed Git and Node.JS without any problems, and everything was OK (I think; I'm not a web developer and I may be missing something) until i tried debugging (ctrl+f5) .
when i enter visual studio, contrary to what Satchin said in the video, the application is not continuously integrating. My Task runner explorer has this info:
Failed to run "C:\Users\L.Ricardo\Documents\GitHub\powerbi-visuals\Gulpfile.js"...
cmd.exe /c gulp --tasks-simple
Error: Cannot find module 'accord'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\L.Ricardo\Documents\GitHub\powerbi-visuals\node_modules\gulp-less\index.js:2:22)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
Javascript language reference has this info:
11:30:09.2572: Referenced file 'C:\Users\L.Ricardo\Documents\GitHub\powerbi-visuals\src\Clients\PowerBIVisualsPlayground\externals.min.js' not found.
11:30:09.2572: Referenced file 'C:\Users\L.Ricardo\Documents\GitHub\powerbi-visuals\src\Clients\PowerBIVisualsPlayground\powerbi-visuals.js' not found.
11:30:09.2572: Referenced file 'C:\Users\L.Ricardo\Documents\GitHub\powerbi-visuals\src\Clients\PowerBIVisualsPlayground\PowerBIVisualsPlayground.js' not found.
11:30:10.0229: Referenced file 'externals.min.js' not found.
11:30:10.0229: Referenced file 'powerbi-visuals.js' not found.
11:30:10.0229: Referenced file 'PowerBIVisualsPlayground.js' not found."
(some info maybe from previous tries...)
in the webpage, the dropdowns don't work. The error seems to be:
0x800a1391 - runtime error JavaScript: '$' line 51 is not defined
...which I think means that I need to install JSON support.
So, how do I install JSON support in Visual Studio 2015?
Or is there some other reason for the problems I'm seeing?
From the sound of it you might have missed the "One Time setup" steps. https://github.com/microsoft/powerbi-visuals
One-Time Setup
In order to build the Power BI visuals, ensure that you have Git and Node.js installed.
Clone a copy of the repo:
git clone https://github.com/Microsoft/PowerBI-visuals.git
Change to the PowerBI-visuals directory:
cd PowerBI-visuals
Install dev dependencies:
npm install # This command will install Gulp and all necessary modules
turns out there were happening errors when running npm install.
I executed npm cache clean and then npm install and now it's working!
Thanks