Trying to run my jasmine tests, writeen in ES2015 via Babel, in phantomjs via karma-phantomjs; getting this issue--
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
ReferenceError: Can't find variable: Map
at /var/folders/mf/n6g7nwd119vbmkg80d0yvm380000gn/T/19f6091b4a350b18bbe890201c914b34.browserify:26852 <- node_modules/mocktail/dist/mocktail.js:41:0
Ran npm install --save-dev babel-polyfill, modified my setup.js mocktail file like so:
import 'babel-polyfill';
import {env, ENV} from 'mocktail';
env(ENV.TESTING);
Related
I'm running the following:
Ubuntu 18.04.6 LTS
node 14.20.0
npm 8.17.0
gulp CLI 2.3.0
gulp Local 4.0.2
When I try running gulp, I get:
'bundleScripts' errored after 189 ms
ValidationError: Invalid options object. Terser Plugin has been initialized using an options object that does not match the API schema.
options has an unknown property 'sourceMap'.
I've tried many suggestions:
updating everything (all up-to-date)
reinstalling node.js, npm and gulp
removing and reinstalling terser-webpack-plugin
removing terser-webpack-plugin completely
I'm trying run the vue command on the Windows command prompt.
I installed Node and then Vue CLI by using command npm install -g #vue/cli, but when I run vue create test, I see an error. I reinstalled Node and #vue/cli, but that didn't work. Here's the error:
Vue CLI requires Node 8.9+, as stated in the docs:
Node Version Requirement
Vue CLI requires Node.js version 8.9 or above (8.11.0+ recommended). You can manage multiple versions of Node on the same machine with nvm or nvm-windows.
The error indicates a syntax error for the async keyword, which is not supported in older versions of Node.
I was wondering if anyone has come across an issue where they do an npm install and the package appears in package.json but not in node_modules. Example:
I type
npm install --save-dev jest enzyme enzyme-adapter-react-16
These packages appear in package.json but when I type jest on the command line I get the error message: Cannot find module 'enzyme' from 'enzyme.config.js'
With enzyme.config.js being:
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
I looked in package.json and the packages are there but the packages are not in the node_modules folder. Any idea why this could happen? Any help would be much appreciated.
This has been solved. The TL;DR; of this is: In production mode npm doesn't install dev dependencies. I changed NODE_ENV variable to production then to 'remove' it I just commented it out and re sourced bash profile. This doesn't remove production mode. I had to go and set it explicitly again to undo production.
Node version : v8.11.4
npm version: 5.6.0
Commands fired
npm install -g vue-cli
npm install -g vue
vue install wepack test
Following error is thrown
'vue' is not recognized as an internal or external command,operable program or batch file.
When I type vue -v also, I am getting the above error
I also added to windows the path of Vue.js
I also noticed that vue.cmd is not coming the following directory
C:\Users\HP\AppData\Roaming\npm
Can anybody please help me to sort the problem
I solved my problem by not running my command terminal as an administrator. I opened my cmder terminal normally by double clicking and it worked.
I am trying to run ng test in Angular Cli project using phantom browser and I am getting below error. I googled it and realized that it has something to do with polyfill (Backward compatibility?). I want to understand what's wrong here and how to fix this issue. Thanks in advance!
PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
TypeError: undefined is not an object (evaluating '(_a = ((Object))).assign.apply')
at webpack:///~/#angular/common/src/pipes/intl.js:187:0 <- src/test.ts:34449
you need to uncomment those from your polyfills.ts
import 'core-js/es6/object';
import 'core-js/es6/array';
import 'intl'; // Run `npm install --save intl`.