Lerna command in AWS Codebuild - continuous-integration

Error: Cannot find module '.'
Require stack:
- /codebuild/output/src309915592/src/node_modules/.bin/lerna
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/codebuild/output/src309915592/src/node_modules/.bin/lerna:11:3)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/codebuild/output/src309915592/src/node_modules/.bin/lerna' ]
}
I get this error on running the test command:
lerna run --stream test --parallel
Also, tried with
lerna run --stream test --parallel --scope tenant-registration-service
In the services, test script looks like,
"test": "serverless-bundle test --verbose --coverage",
I installed Lerna globally in the pipeline. How do I debug this? What module is it not able to find? It looks like it already has lerna installed which it should.
npm run test command runs just fine on the local system.

Related

SyntaxError Unexpected token in Cypress

I am trying to setup Cypress in my laptop, but I get this error when I try to execute the example tests. I tried to clear the cypress cache and reinstall cypress, but got the same error. here is screen shot of what syntax error I receive when I hit "npm run test".
This is what I get in the terminal after I hit "npm run test"
C:\Users\u46827\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\run_plugins.js:40
invoke = (eventId, args = []) => {
SyntaxError: Unexpected token =
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\u46827\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\run_require_async_child.js:6:24)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[3544:0904/215759.289:ERROR:dns_config_service.cc(278)] DNS config watch failed.
Please open screenshot here
I found the issue. My node version was old. I updated it to 16

Truffle Drizzle Tutorial fails on last step 'npm run dev'

I am on windows 10, using vscode. Basically finished the petshop tutorial with no issues or problems using truffle.
when I enter the command npm run dev it fails as shown below.
PS Y:\code\petshop> npm run dev
> pet-shop#1.0.0 dev
> lite-server
internal/modules/cjs/loader.js:316
throw err;
^
Error: Cannot find module 'Y:\code\petshop\node_modules\immutable\dist\immutable'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:308:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:521:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)
at Function.Module._load (internal/modules/cjs/loader.js:730:27)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (Y:\code\petshop\node_modules\browser-sync\dist\hooks.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32) {
code: 'MODULE_NOT_FOUND',
path: 'Y:\\code\\petshop\\node_modules\\immutable\\package.json',
requestPath: 'immutable'
}
Not sure where to go from here, nothing works. This type of error is a bit beyond me. Any and all help is greatly appreciated.
EDIT: changed screenshot to code snippet. And I realized the problem is that the 'immutable' path is non-existent in my node_modules. Still not sure how to address this. tried a cheeky npm install immutable to no avail....

Too many errors

This is the error I start with:
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-08-10T10_15_35_198-debug.log
then continues from this
State changed from crashing to starting
Starting process with command `node idex.js`
State changed from starting to up
Process exited with status 1
State changed from up to crashed
still...
ReferenceError: client is not defined
at Object.<anonymous> (/app/music.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:1137:20)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:100
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/app/index.js:9:11)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
What should I do?
missing script: start
You're probably using npm start [script].
You need to configure your package.json "scripts" object.
It requires a "start": "your/file" in the "scripts" object, to start with.
Here's an example.
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon src/server.js",
"dev": "src/server.js"
}
client is not defined
In music.js, line 10, you have a variable client that hasn't seemed to be defined, thus it is unable to access it.
All this leads to your file being unable to start and crashing constantly, which is shown in your second image.

RxJs-5-to-6-migrate crashes

I'm trying to update my project from Angular 4 to Angular 6.
I followed the update steps found on the Angular website and all goes quite smoothly.
However, when trying to use the rxjs-5-to-6-migrate script, it crashes.
I've tried various variations of paths, but noothing seems to work.
I've no idea what's going on...
PS D:\workspace\project> rxjs-5-to-6-migrate -p src/tsconfig.app.json
Running the automatic migrations. Please, be patient and wait until the execution completes.
child_process.js:615
throw err;
^
Error: Command failed: "d:\Applications\node-v9.11.1-win-x64\node_modules\rxjs-tslint\node_modules\.bin\tslint" -c "d:\Applications\node-v9.11.1-win-x64\node_modules\rxjs-tslint\rxjs-5-to-6-migrate.json" -p "src/tsconfig.app.json" --fix
at checkExecSyncError (child_process.js:575:11)
at Object.execSync (child_process.js:612:13)
at migrate (d:\Applications\node-v9.11.1-win-x64\node_modules\rxjs-tslint\rxjs-5-to-6-migrate.js:18:34)
at Object.<anonymous> (d:\Applications\node-v9.11.1-win-x64\node_modules\rxjs-tslint\rxjs-5-to-6-migrate.js:25:14)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
Apparently it was a outdated dependency (probably tslint) what caused this. After updating all dependencies in the package.json, it worked.

Run package specs in Atom Editor always causes error

Atom Editor can be found here: https://atom.io/
Discourse thread about this issue here: http://discuss.atom.io/t/application-run-all-specs-fail-to-run/7541
I am running: MBP (OS X 10.9.2) with Atom 0.84.0 and Node 0.10.26.
When I do View > Developer > Run atom specs
- Nothing happens, no window opens, inspector doesn't open
When I do
apm develop vim-mode
cd ~/github/vim-mode
atom .
View > Developer > Run package specs
- Nothing happens, no window opens, inspector doesn't open
I then tried
~/github/vim-mode $ apm test
[764:0409/142738:INFO:renderer_main.cc(227)] Renderer process started
No window opened, however another Atom program launched with a menu containing "Atom > [Reload, Close, Toggle, Quit]"
After pressing Quit, the terminal said "Tests passed". None of the other buttons worked
~/github/vim-mode $ apm test
[645:0409/141838:INFO:renderer_main.cc(227)] Renderer process started
Tests passed
I don't think they actually passed, "Tests passed" only showed up after quitting the window
I then tried atom -d
And an identical program started with no window
I then tried running tests via another way
~/github/vim-mode $ atom -t
[833:0409/143232:INFO:renderer_main.cc(227)] Renderer process started
[831:0409/143236:INFO:CONSOLE(27)] "Error: Cannot find module '../lib/ui-watcher.coffee'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:279:25)
at Module.require (module.js:363:17)
at require (module.js:379:17)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/spec/ui-watcher-spec.js:8:15)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/node_modules/dev-live-reload/spec/ui-watcher-spec.js:185:4)
at Module._compile (module.js:455:26)
at Object.Module._extensions..js (module.js:473:10)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:363:17)
at require (module.js:379:17)
at requireSpecs (/Applications/Atom.app/Contents/Resources/app/spec/spec-suite.coffee:9:5)
at runAllSpecs (/Applications/Atom.app/Contents/Resources/app/spec/spec-suite.coffee:47:3)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/spec/spec-suite.coffee:58:3)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/spec/spec-suite.coffee:1:1)
at Module._compile (module.js:455:26)
at Object.requireCoffeeScript [as .coffee] (/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js:64:19)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:363:17)
at require (module.js:379:17)
at module.exports.runSpecSuite (/Applications/Atom.app/Contents/Resources/app/spec/jasmine-helper.coffee:30:3)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/spec/spec-bootstrap.coffee:24:3)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/spec/spec-bootstrap.coffee:2:1)
at Module._compile (module.js:455:26)
at Object.requireCoffeeScript [as .coffee] (/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js:64:19)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:363:17)
at require (module.js:379:17)
at window.onload (file:///Applications/Atom.app/Contents/Resources/app/static/index.js:20:5)
", source: /Applications/Atom.app/Contents/Resources/app/spec/spec-bootstrap.coffee (27)
This issue is not relevant any longer, problem solved after reinstallation.

Resources