eslint-config-react-app/jest': Cannot read property 'meta' of undefined - docker

I create a project with create-react-app. I get this error when i run docker build frontend -t my-frontend . :
> frontend#0.1.0 build /app
> react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to load plugin 'jest' declared in 'package.json » eslint-config-react-app/jest': Cannot read property 'meta' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend#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! /root/.npm/_logs/2022-01-27T11_11_23_140Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
how should i fix it? i tried npm install,npm install .,npm audit fix.
this is jest in my package.json :
{
...
"dependencies": {
"#testing-library/jest-dom": "^5.11.4",
"#testing-library/react": "^11.1.0",
"#testing-library/user-event": "^12.1.10",
...,
"web-vitals": "^1.0.1"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
...
}
and this is jest in my package.lock.json :
"eslint-plugin-jest": {
"version": "24.1.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz",
"integrity": "...",
"requires": {
"#typescript-eslint/experimental-utils": "^4.0.1"
}
},
I also saw eslint-plugin-jest gives "ESLint stack trace: TypeError: Cannot read property 'meta' of undefined" that says: " This was a temporary issue in 22.6 up to 22.6.2" but my version is 24.1.3 .

Fixed by npm audit fix --force but before run, make sure it does not damage your project.
npm audit fix only modifies the dependencies that shouldn't cause problems based on SEMVER rules. The --force is a dangerious option because it upgrades the dependencies regardless of any rules. This can cause a dependency to go from version 1.2. 0 to version 2.3.
What did a npm audit fix --force change and how do you fix it?

Related

tfx extension create failed while running npm script

I'm using this package to compile and build my extension
{
"id": "extensionAzureDevOps",
"name": "extension",
"publisher": "ME",
"version": "0.0.63",
"description": "Azure DevOps Extension",
"keywords": [
"extensions",
"Azure DevOps",
"Visual Studio Team Services"
],
"engines": {
"vscode": "^1.8.0"
},
"license": "MIT",
"repository": {
"type": "git",
"url": ""
},
"scripts": {
"clean": "rimraf ./dist",
"compile": "npm run clean && npm run test && webpack --mode production",
"compile:dev": "npm run clean && npm run test && webpack --mode development",
"build": "npm run compile",
"build:dev": "npm run compile:dev && npm run postbuild",
"postbuild": "npm run package-extension -- --rev-version",
"package-extension": "tfx extension create --manifest-globs azure-devops-extension.json src/TabExtension/*.json",
"publish-extension": "tfx extension publish --manifest-globs azure-devops-extension.json src/TabExtension/*.json",
"test": "set TEST_REPORT_FILENAME=test-results.xml && jest --verbose"
},
"dependencies": {
"#fluentui/react": "^8.36.3",
"azure-devops-extension-api": "~1.157.0",
"azure-devops-extension-sdk": "~2.0.11",
"azure-devops-ui": "~2.164.0",
"react": "~16.13.1",
"react-dom": "~16.13.1"
},
"devDependencies": {
"#testing-library/jest-dom": "^5.11.0",
"#testing-library/react": "^10.4.4",
"#types/jest": "^26.0.3",
"#types/react": "~16.8.2",
"#types/react-dom": "~16.8.0",
"copy-webpack-plugin": "^7.0.0",
"base64-inline-loader": "~1.1.1",
"css-loader": "~1.0.0",
"jest": "^26.1.0",
"jest-junit-reporter": "^1.1.0",
"node-sass": "^5.0.0",
"rimraf": "~2.6.2",
"sass-loader": "~10.0.5",
"style-loader": "~0.23.1",
"tfx-cli": "^0.6.3",
"ts-jest": "^26.1.1",
"ts-loader": "~5.2.2",
"typescript": "^3.9.6",
"webpack": "^5.23.0",
"webpack-cli": "^4.5.0"
},
"jest": {
"transform": {
"^.+\\.(js|ts|tsx|jsx)$": "ts-jest"
},
"transformIgnorePatterns": [
"node_modules/(?!(react-native|azure-devops-ui|azure-devops-extension-sdk)/)"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js",
"\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js"
},
"preset": "ts-jest/presets/js-with-babel",
"testResultsProcessor": "./node_modules/jest-junit-reporter",
"collectCoverage": true,
"coverageReporters": [
"json",
"html",
"cobertura"
],
"globals": {
"ts-jest": {
"tsconfig": "tsconfig.test.json"
}
}
}
}
When I run the command npm run postbuild, I receive this error:
tfx extension create --manifest-globs azure-devops-extension.json src/TabExtension/*.json "--rev-version"
tfx extension create --manifest-globs azure-devops-extension.json src/TabExtension/*.json "--rev-version"
(node:89172) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
TFS Cross Platform Command Line Interface v0.6.4
Copyright Microsoft Corporation
error: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Inplace
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! feedback-extension-for-azuredevops#0.0.63 package-extension: `tfx extension create --manifest-globs azure-devops-extension.json src/TabExtension/*.json "--rev-version"`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the feedback-extension-for-azuredevops#0.0.63 package-extension 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\t-nashak\AppData\Roaming\npm-cache\_logs\2021-12-08T15_15_13_712Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! feedback-extension-for-azuredevops#0.0.63 postbuild: `npm run package-extension -- --rev-version`
npm ERR! Exit status 4294967295
npm ERR!
But when I run the command tfx extension create --manifest-globs azure-devops-extension.json src/TabExtension/*.json --rev-version it works well
what causes the dependencies cycle? how can I fix it?
note: if I remove the param --rev-version it will work well
I had the same issue. I guess the postbuild command is wrong:
"postbuild": "npm run package-extension -- --rev-version"
This works:
"postbuild": "npm run package-extension --rev-version"

How can I inject environment variables during the build process in Github CI/CD?

I am creating a blogsite with Gatsby and Contentful for learning purposes. I want to deploy my site to surge using Github actions. I am using gatsby-source-contentful plugin to get my content from Contentful at build time. The plugin requires spaceId and accessToken to access my Contenful space. During development at my local machine, I am providing these values to the plugin using environment variables saved in a .env file.
However, during the build process in Github actions, I am getting this error:
success open and validate gatsby-configs - 2.325s
error Invalid plugin options for "gatsby-source-contentful":
- "accessToken" is required
- "spaceId" is required
not finished load plugins - 1.002s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-contentful-blogsite#0.1.0 build: `tsc && gatsby build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-contentful-blogsite#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/runner/.npm/_logs/2021-02-18T17_53_11_281Z-debug.log
Error: Process completed with exit code 1.
Is there a way to tell Github actions about these environment variables (spaceId and accessToken) so that the gatsby-source-contentful plugin can be configured successfully?
Contentful DevRel here. 👋
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-contentful`,
options: {
spaceId: `your_space_id`,
// Learn about environment variables: https://gatsby.dev/env-vars
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
},
},
],
}
In your gatsby config you can specify your environment variable such as above. Then in your GitHub repo you can define a secret and expose it as environment variable. You can find more information in the Github actions docs. Once you exposed the environment variable via the secret to the action, it should work fine.

Electron-builder: resource busy or locked. Failed to create installer

I have a little test electron app named hello world. I am trying to build it and generate a windows installer using electron-builder. My package.json is as follows.
{
"name": "hello-world",
"productName": "Hello World",
"version": "1.0.0",
"description": "Second attempt at an electron app",
"main": "main.js",
"dependencies": {},
"devDependencies": {
"electron": "^9.1.1",
"electron-builder": "^22.8.0"
},
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Computronics",
"license": "MIT",
"build": {
"appId": "com.hello.world",
"win": {
"target": "nsis"
}
}
}
When I run npm run dist it outputs this.
> hello-world#1.0.0 dist C:\Users\computronics\source\repos\electrontests\hello world
> electron-builder
• electron-builder version=22.8.0 os=10.0.18362
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=9.1.2 appOutDir=dist\win-unpacked
⨯ EBUSY: resource busy or locked, rename 'C:\Users\computronics\source\repos\electrontests\hello world\dist\win-unpacked\electron.exe' -> 'C:\Users\computronics\source\repos\electrontests\hello world\dist\win-unpacked\Hello World.exe' stackTrace=Error: EBUSY: resource busy or locked, rename 'C:\Users\computronics\source\repos\electrontests\hello world\dist\win-unpacked\electron.exe' -> 'C:\Users\computronics\source\repos\electrontests\hello world\dist\win-unpacked\Hello World.exe'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-world#1.0.0 dist: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-world#1.0.0 dist 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\computronics\AppData\Roaming\npm-cache\_logs\2020-07-31T19_00_12_846Z-debug.log
The contents of the log file is as follows:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dist'
1 verbose cli ]
2 info using npm#6.14.6
3 info using node#v12.18.3
4 verbose run-script [ 'predist', 'dist', 'postdist' ]
5 info lifecycle hello-world#1.0.0~predist: hello-world#1.0.0
6 info lifecycle hello-world#1.0.0~dist: hello-world#1.0.0
7 verbose lifecycle hello-world#1.0.0~dist: unsafe-perm in lifecycle true
8 verbose lifecycle hello-world#1.0.0~dist: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\computronics\source\repos\electrontests\hello world\node_modules\.bin;C:\Program Files\Microsoft VS Code\bin;C:\Windows\System32;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7-preview\preview;C:\ProgramData\chocolatey\bin;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Users\computronics\.dotnet\tools;
9 verbose lifecycle hello-world#1.0.0~dist: CWD: C:\Users\computronics\source\repos\electrontests\hello world
10 silly lifecycle hello-world#1.0.0~dist: Args: [ '/d /s /c', 'electron-builder' ]
11 silly lifecycle hello-world#1.0.0~dist: Returned: code: 1 signal: null
12 info lifecycle hello-world#1.0.0~dist: Failed to exec dist script
13 verbose stack Error: hello-world#1.0.0 dist: `electron-builder`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid hello-world#1.0.0
15 verbose cwd C:\Users\computronics\source\repos\electrontests\hello world
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dist"
18 verbose node v12.18.3
19 verbose npm v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error hello-world#1.0.0 dist: `electron-builder`
22 error Exit status 1
23 error Failed at the hello-world#1.0.0 dist script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
After running npm run dist it creates a working .exe in dist called electron.exe. This launches into the simple hello world app.
I have tried deleting the node_modules folder and reinstalling the dependencies, forcefully cleaning the npm cache and trying different versions of electron-builder.
Other information
OS: Windows 10
npm version: 6.14.6
node version: 12.18.3
Thanks in advance for any help.
There may be more than one reason for this error. Here are the ways you can get rid out of this error.
Solution 1. Close the browser_broker process
Open up the Windows task manager, find the running process named either browser_broker.exe or Runtime Broker and stop the process. After stopping the process, try building the installer again and it will work.
Solution 2. Kill the Build Tools Process
Open task manager and kill the BuildTolls_Full.exe process. Then Go to C:\Users<User Name>.windows-build-tools and open build-tools-log.txt with a text-editor and append the given and save the file.
Variable: IsInstalled = 1

Angular production release does not create my-app folder in dist - Azure DevOps

When running ng build --prod --aot locally, it creates a my-app folder perfectly fine within the dist/ folder. Inside I have the expected mian,polyfills and runtime js files (with a hash value).
When running it in Azure DevOps (VSTS) it does not, only a out-tsc folder is created.
My angular.json
"projects": {
"my-app": {
"root": "",
"sourceRoot": "./ClientApp",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/my-app",
"index": "./ClientApp/index.html",
"main": "./ClientApp/main.ts",
"polyfills": "./ClientApp/polyfills.ts",
"tsConfig": "./ClientApp/tsconfig.app.json",
"assets": [
"./ClientApp/favicon.ico",
"./ClientApp/assets"
],
"styles": [
"./ClientApp/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "./ClientApp/environments/environment.ts",
"with": "./ClientApp/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
Running it locally:
PS C:\Users\USER\Source\Repos\MyProject\MyProject.MVC> npm run buildconfigprod --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\USER\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'run',
npm verb cli 'buildconfigprod',
npm verb cli '--verbose' ]
npm info using npm#6.4.0
npm info using node#v8.9.4
npm verb run-script [ 'prebuildconfigprod',
npm verb run-script 'buildconfigprod',
npm verb run-script 'postbuildconfigprod' ]
npm info lifecycle my-app#0.0.0~prebuildconfigprod: my-app#0.0.0
npm info lifecycle my-app#0.0.0~buildconfigprod: my-app#0.0.0
> my-app#0.0.0 buildconfigprod C:\Users\USER\Source\Repos\MyProject\MyProject.MVC
> ng build my-app --configuration production
Your global Angular CLI version (6.2.1) is greater than your local
version (6.1.5). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Date: 2018-10-16T12:45:26.931Z
Hash: fdf36103c4e08ff1c324
Time: 21386ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.a474c4b2064489e33e1b.css (styles) 0 bytes [initial] [rendered]
chunk {2} polyfills.001789666250e4564d51.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.aecca14d2a03e91e82ca.js (main) 660 kB [initial] [rendered]
npm verb lifecycle my-app#0.0.0~buildconfigprod: unsafe-perm in lifecycle true
npm verb lifecycle my-app#0.0.0~buildconfigprod: PATH: C:\Users\USER\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\USER\Source\Repos\MyProject\MyProject.MVC\node_modules\.bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\GnuPG\bin;C:\Program Files\SafeNet\Authentication\SAC\x64;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files\Git\cmd;C:\Users\USER\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\USER\AppData\Roaming\npm;C:\Users\USER\.dotnet\tools
npm verb lifecycle my-app#0.0.0~buildconfigprod: CWD: C:\Users\USER\Source\Repos\MyProject\MyProject.MVC
npm info lifecycle my-app#0.0.0~postbuildconfigprod: my-app#0.0.0
npm verb exit [ 0, true ]
npm timing npm Completed in 26723ms
npm info ok
Build config:
step 1 npm install:
step 2 npm run release:
where release has the following script command within package.json:
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"release": "ng build --prod --aot",
"buildconfigprod": "ng build my-app --configuration production",
"runprod": "ng run my-app:build:production",
"e2e": "ng e2e"
},
So I have also tried different ways of running it, but no result so far.
Log file of Azure DevOps:
2018-10-16T12:43:06.5605572Z ##[section]Starting: npm build angular app MVC
2018-10-16T12:43:06.5611048Z ==============================================================================
2018-10-16T12:43:06.5611217Z Task : npm
2018-10-16T12:43:06.5611638Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
2018-10-16T12:43:06.5611811Z Version : 1.0.24
2018-10-16T12:43:06.5611948Z Author : Microsoft Corporation
2018-10-16T12:43:06.5612115Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
2018-10-16T12:43:06.5612281Z ==============================================================================
2018-10-16T12:43:07.1829249Z SYSTEMVSSCONNECTION exists true
2018-10-16T12:43:07.4015731Z SYSTEMVSSCONNECTION exists true
2018-10-16T12:43:07.4892005Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\npm\prefix\npm.cmd --version"
2018-10-16T12:43:07.8349637Z 6.4.0
2018-10-16T12:43:08.6554123Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\npm\prefix\npm.cmd config list"
2018-10-16T12:43:09.0251326Z ; cli configs
2018-10-16T12:43:09.0251779Z metrics-registry = "https://registry.npmjs.org/"
2018-10-16T12:43:09.0251984Z scope = ""
2018-10-16T12:43:09.0252178Z user-agent = "npm/6.4.0 node/v8.12.0 win32 x64"
2018-10-16T12:43:09.0252301Z
2018-10-16T12:43:09.0252479Z ; environment configs
2018-10-16T12:43:09.0252659Z cache = "C:\\npm\\cache"
2018-10-16T12:43:09.0252830Z loglevel = "verbose"
2018-10-16T12:43:09.0253434Z prefix = "C:\\npm\\prefix"
2018-10-16T12:43:09.0254273Z userconfig = "D:\\a\\1\\npm\\619.npmrc"
2018-10-16T12:43:09.0254488Z
2018-10-16T12:43:09.0254712Z ; builtin config undefined
2018-10-16T12:43:09.0254864Z
2018-10-16T12:43:09.0255099Z ; node bin location = C:\Program Files\nodejs\node.exe
2018-10-16T12:43:09.0255339Z ; cwd = D:\a\1\s\MyProject.MVC
2018-10-16T12:43:09.0255574Z ; HOME = C:\Users\VssAdministrator
2018-10-16T12:43:09.0255809Z ; "npm config ls -l" to show all defaults.
2018-10-16T12:43:09.0256006Z
2018-10-16T12:43:09.0257369Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\npm\prefix\npm.cmd run release"
2018-10-16T12:43:09.0258780Z npm info it worked if it ends with ok
2018-10-16T12:43:09.0259425Z npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
2018-10-16T12:43:09.0259656Z npm verb cli 'C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js',
2018-10-16T12:43:09.0259847Z npm verb cli 'config',
2018-10-16T12:43:09.0260037Z npm verb cli 'list' ]
2018-10-16T12:43:09.0260233Z npm info using npm#6.4.0
2018-10-16T12:43:09.0260415Z npm info using node#v8.12.0
2018-10-16T12:43:09.0260598Z npm verb exit [ 0, true ]
2018-10-16T12:43:09.0260766Z npm timing npm Completed in 58ms
2018-10-16T12:43:09.0260944Z npm info ok
2018-10-16T12:44:12.2488227Z npm info it worked if it ends with ok
2018-10-16T12:44:12.2488475Z
2018-10-16T12:44:12.2489256Z > my-app#0.0.0 release D:\a\1\s\MyProject.MVC
2018-10-16T12:44:12.2489977Z npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
2018-10-16T12:44:12.2490873Z npm verb cli 'C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js',
2018-10-16T12:44:12.2491258Z npm verb cli 'run',
2018-10-16T12:44:12.2491522Z npm verb cli 'release' ]
2018-10-16T12:44:12.2491785Z npm info using npm#6.4.0
2018-10-16T12:44:12.2492045Z npm info using node#v8.12.0
2018-10-16T12:44:12.2492318Z npm verb run-script [ 'prerelease', 'release', 'postrelease' ]
2018-10-16T12:44:12.2492601Z npm info lifecycle my-app#0.0.0~prerelease: my-app#0.0.0
2018-10-16T12:44:12.2492905Z npm info lifecycle my-app#0.0.0~release: my-app#0.0.0
2018-10-16T12:44:12.2493192Z npm verb lifecycle my-app#0.0.0~release: unsafe-perm in lifecycle true
2018-10-16T12:44:12.2494714Z npm verb lifecycle my-app#0.0.0~release: PATH: C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\1\s\MyProject.MVC\node_modules\.bin;C:\hostedtoolcache\windows\NuGet\4.5.0\x64;C:\agents\2.140.2\externals\git\cmd;C:\tools\mingw64\bin;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\jdk1.8.0_181\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64;C:\Program Files\Microsoft MPI\Bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files (x86)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps
2018-10-16T12:44:12.2497292Z npm verb lifecycle my-app#0.0.0~release: CWD: D:\a\1\s\MyProject.MVC
2018-10-16T12:44:12.2497608Z npm info lifecycle my-app#0.0.0~postrelease: my-app#0.0.0
2018-10-16T12:44:12.2497897Z npm verb exit [ 0, true ]
2018-10-16T12:44:12.2498803Z npm timing npm Completed in 62897ms
2018-10-16T12:44:12.2499072Z npm info ok
2018-10-16T12:44:12.2499965Z > ng build --prod --aot
2018-10-16T12:44:12.2500240Z
2018-10-16T12:44:12.2500383Z
2018-10-16T12:44:12.2500635Z Date: 2018-10-16T12:44:12.131Z
2018-10-16T12:44:12.2500900Z Hash: fdf36103c4e08ff1c324
2018-10-16T12:44:12.2501151Z Time: 58602ms
2018-10-16T12:44:12.2501432Z chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
2018-10-16T12:44:12.2501739Z chunk {1} styles.a474c4b2064489e33e1b.css (styles) 0 bytes [initial] [rendered]
2018-10-16T12:44:12.2502068Z chunk {2} polyfills.001789666250e4564d51.js (polyfills) 59.6 kB [initial] [rendered]
2018-10-16T12:44:12.2502378Z chunk {3} main.aecca14d2a03e91e82ca.js (main) 660 kB [initial] [rendered]
2018-10-16T12:44:12.2630774Z ##[section]Finishing: npm build angular app MVC
Output artifacts as said only contains a dist/out-tsc folder and no dist/my-app folder.
The angular project is within an ASP.NET MVC 4.5 application, which is build after this is executed.
Also tried to install version 6.4.0 of NPM within the build definitions.
What am I doing wrong and wasting my day on?
EDIT:
I have this sequence:
I have diagnosed so far that the zip file does contain the valid files I am looking for! Hooray... So when the solution is build, it clears the dist/ file and then generates the out-tsc folder. That is not convenient. How can I keep these files in there? What is causing the .net build to clear the dist folder and generate the out-tsc files?
So I now need to find a way to keep the files in the dist folder during build. Doing it the other way around won't work because during the MVC Build I also turn it into a deploy package.
I have the following settings which is working fine as expected in all the environments.
No need to have "RunPostBuildEvent" or "PostBuildEvent" or "BeforeTargets" set up in csproj
No need to publish all files in project folder
Also build definition is created as in below with command link task.
I eventually solved this by changing the setting below, the default setting is "Only files needed to run this application". So it will remove node_modules and dist/my-app.
This will make sure that all files in the project folder will be pushed to the publish folder. It does has some drawbacks so I rather see another solution that will make sure that the node_modules folder and the dist/my-app folder are part of the application and needed to run the application.

Solving Peer Dependency requirements in react-native

I have the following package.json:
{
"name": "MovieReview",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"lodash": "^4.13.1",
"moment": "^2.13.0",
"native-base": "0.4.7",
"react": "15.1.0",
"react-native": "0.27.2",
"react-native-button": "^1.6.0",
"react-native-code-push": "^1.12.1-beta",
"react-native-easy-grid": "^0.1.6",
"react-native-gifted-spinner": "0.0.4",
"react-native-modalbox": "^1.3.3",
"react-native-router-flux": "^3.30.4",
"react-native-vector-icons": "^2.0.3",
"react-native-webview-android": "^1.1.6",
"react-redux": "4.4.5",
"redux": "^3.5.2",
"redux-persist": "^3.2.2",
"redux-thunk": "^2.1.0",
"rx": "^4.1.0",
"youtube-api": "^2.0.2"
},
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^2.5.3",
"remote-redux-devtools": "^0.3.3",
"remote-redux-devtools-on-debugger": "^0.4.6"
}
}
I am trying to install the dependencies in this package.json. I have node v4.0.0 installed in my system.
My react-native version is 0.27.2:
$ react-native --version
react-native-cli: 1.0.0
react-native: 0.27.2
I am getting the following dependency errors when I try run npm install in my project folder:
$ sudo npm install
Password:
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/triple.s/.nvm/versions/node/v4.0.0/bin/node" "/Users/triple.s/.nvm/versions/node/v4.0.0/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package react#15.1.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer native-base#0.4.7 wants react#15.0.2 - 15.1.0
npm ERR! peerinvalid Peer react-native#0.27.2 wants react#15.1.0
npm ERR! peerinvalid Peer react-redux#4.4.5 wants react#^0.14.0 || ^15.0.0-0
npm ERR! Please include the following file with any support request:
npm ERR! /Users/triple.s/Desktop/MovieReview/npm-debug.log
I tried changing the react version to 15.0.0 and 15.0.2 by modifying package.json, but still getting the same kind of error.
EDIT:
I updated npm using npm install -g npm and tried to install dependencies,
the following warning messages were thrown:
npm WARN native-base#0.4.7 requires a peer of react#15.0.2 - 15.1.0 but none was installed.
npm WARN react-native#0.27.2 requires a peer of react#15.1.0 but none was installed.
Does that mean, native-base and react-native not installed?

Resources