ERR! Missing script: "build" - node.js

ERR! Missing script: "build"

There is no script named 'build' in your package.json file.You can try npm run start command to get started

Related

Error keeps occurring while doing npm run deploy

When I try npm run deploy, Error occured.
I can't understand error message...
How can I resolve this problem??
> habit-tracker#0.1.0 deploy
> gh-pages -d build
Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).
npm ERR! code 1
npm ERR! path C:\Users\me\react_projects\react-basic\habit-tracker
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c gh-pages -d build
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Local\npm-cache\_logs\2021-03-22T06_15_37_037Z-debug.log

Why can't npm start?

I got a new notebook, so I install all languages I use. I use nodejs v10.16.
I had an Angular code which I wanted to run on the new notebook. The version of the node was the same. However, when I wrote in the command line npm start, I got these message:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <my-project>-client#0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <my-project>-client#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Why did it happend? I install node_modules before starting and it ran on my earlier notebook.
How should I solve this problem?
Make sure you're running the start script from the same location as your package.json file.
Check the format of package.json scripts object, ensuring the script name is correct and denoting where the script/object ends with a comma.
"scripts": {
"start": "react-scripts start"
},
Ensure the app/module your start script is calling is installed/installed correctly.
Use the full npm command to run your start script:
npm run start
If all else fails, rename your node_modules to node_modules_old, check your package.json file has all your required dependencies and run npm install from the same directory to generate a new node_modules folder before trying to run the script again with npm run start.

firebase deploy No files matching the pattern "'src/**/*'" were found

iam trying to deploy my first cloud function on firebase but the problem is that it always says that there is something wrong and no files are matching the pattern i dont know why even that the index.ts is where it is supposed to be
the error code is
=== Deploying to 'mscmu-aeab1'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions# lint C:\Users\fahmi\msc_mu\cloud_functions\functions
> eslint 'src/**/*'
Oops! Something went wrong! :(
ESLint: 7.9.0
No files matching the pattern "'src/**/*'" were found.
Please check for typing mistakes in the pattern.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions# lint: `eslint 'src/**/*'`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions# lint 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! C:\Users\fahmi\AppData\Roaming\npm-cache\_logs\2020-09-26T22_01_33_578Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2
https://i.imgur.com/rb10Tsi.png
In your functions package.json edit the lint script as follows:
eslint --ext .ts src
This problem is solved in this commit.
In your functions folders open package.json and edit the line starting with lint like this:
"lint": "eslint \"src/**/*\""
This issue is resolved with the Firebase CLI version 8.12.0. The update is to escape quotes around the argument to eslint as shown in this commit.

Error: functions predeploy error: Command terminated with non-zero exit code254

I am using Mac. I have tried to read and implement the solution from this thread, but it doesnt work.
Firebase deploy errors starting with non-zero exit code (space in project path)
I get errors when deploying the code to firebase:
i deploying functions Running command: npm --prefix "%RESOURCE_DIR%"
run lint npm ERR! path
/Users/muchammadagunglaksana/Desktop/tsCobaDoangCloudFunction/%RESOURCE_DIR%/package.json
npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR!
enoent ENOENT: no such file or directory, open
'/Users/muchammadagunglaksana/Desktop/tsCobaDoangCloudFunction/%RESOURCE_DIR%/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR!
/Users/muchammadagunglaksana/.npm/_logs/2018-09-07T09_10_49_146Z-debug.log
Error: functions predeploy error: Command terminated with non-zero
exit code254
in firebase.json I have tried to modify and use:
"npm --prefix \"%RESOURCE_DIR%\" run lint"
but i still get the error message like the picture above, what should I do?
%RESOURCE_DIR% is a Windows syntax. You should use $RESOURCE_DIR as you are on Mac.
reinitialize your project
firebase init

AWS CodeDeploy AfterInstall script is being run from code-deploy agent dir

I'm trying to run AfterInstall script in AWS code deploy, but it is being run from the /opt/codedeploy-agent/ dir instead of my app directory.
This is how appspec.yml file looks like:
version: 0.0
os: linux
files:
- source: /
destination: /tmp/epub
hooks:
AfterInstall:
- location: server/install-packages.sh
runas: root
As you can see it's a basic example.
Now, the bash script looks like this:
#!/bin/bash
npm install
I just want to npm install and that's it.
Unfortunately I'm getting the error:
LifecycleEvent - AfterInstall
Script - server/install-packages.sh
[stderr]npm ERR! install Couldn't read dependencies
[stderr]npm ERR! Linux 3.13.0-48-generic
[stderr]npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
[stderr]npm ERR! node v4.2.1
[stderr]npm ERR! npm v2.14.7
[stderr]npm ERR! path /opt/codedeploy-agent/package.json
[stderr]npm ERR! code ENOPACKAGEJSON
[stderr]npm ERR! errno -2
[stderr]npm ERR! syscall open
[stderr]
[stderr]npm ERR! package.json ENOENT: no such file or directory, open '/opt/codedeploy-agent/package.json'
[stderr]npm ERR! package.json This is most likely not a problem with npm itself.
[stderr]npm ERR! package.json npm can't find a package.json file in your current directory.
[stderr]
[stderr]npm ERR! Please include the following file with any support request:
[stderr]npm ERR! /opt/codedeploy-agent/npm-debug.log
I was trying different appspec.yml configs like adding runas or adding "/" at the beginning of the location path. All the time it's trying to run from /opt/codedeoploy-agent/ directory.
In desperation, I've set absolute path to the script, but then I got :
Script does not exist at specified location: /tmp/epub/server/install-packages.sh
It's really annoying as I'm doing everything according to docs, but probably I'm missing something very very small !
Thanks
Ok,
So I've found out, that codedeoloy-agent is running AfterInstall (and probably all the other steps) from the temporary directory created by the agent on deploy instance, so in my case I had to modify the bash script by cd-ing to the proper directory:
#!/bin/bash
cd /tmp/epub/server/
npm install

Resources