i'm tying yo host vue webaplication on namecheap hosting. when i install i open it in console has error Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../"
To install a vue project you need to compile it to production. First go to your project and open a terminal, then type npm run build
Vue will build your project for production and leave the result into your dist folder. Then you can upload only the contents of the dist folder into your server
Related
I have a blockchain project whose frontend is implemented in Vuejs. I have installed all the dependencies with "npm install" command. I am trying to set up the development server to serve the front end by running the "npm run serve" command in the /appvue root folder but get a compilation error as follows:
This relative module was not found:
../../build/contracts/SupplyChain.json in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
I am new to VueJs but it looks like the Supplychain.json file cannot be found yet its clearly in the project structure attached.
https://github.com/kafukoM/project_3_Dapp_Supply_Chain
you need to replace line with import in your App.vue file line № 209
from this
import supplyChainArtifact from '../../../build/contracts/SupplyChain.json'
to
import supplyChainArtifact from '../../app/src/SupplyChain.json'
I have a React project with Typescript. One day I create a javascript file in src/ and then my React app failed to start on localhost. Any explanation about this would be appriciated.
Evironment: Node 16.13.1
Step to reproduce:
git clone git#github.com:manaclan/fun-pms-frontend.git
cd fun-pms-frontend
git checkout vinhngo
Inside package.json remove:
"#types/react-facebook-login": "^4.1.4"
"react-facebook-login": "^4.1.1"
Then npm install and npm start will notify that localhost:3000 failed to connect. Removing src/setupProxy.js will make the server start as normal
That's because JavaScript is not allowed in Typescript projects, you would need to modify your Typescript config, add the following flag to to the config file
--allowJs
Depending on the module bundler you probably also have to set the output directory for the transpiled Typescript files.
I am learning the Automated tests by using selenium web driver + Javascript and node.js.
Everything is working fine when I ran that script.js from the Visual Studio code terminal(by using node main.js)
Problem
I want to schedule this script in the scheduler which automatically tests the login functionality. But when I try to run it from the task scheduler then it gives Error: Cannot find module
Does anybody know how to get rid of this.
To fix Cannot find module errors, install the modules properly by running a npm install command in the appropriate directory as your project's app. ... or delete the node_modules folder and package-lock. json file and re-install it again using the npm install command.
rm -rf node_modules package-lock.json
I am trying to bundle an web application that written with ES6 module system & using rollup from command line with custom modules folder that I want use it as root modules directory to be resolved. Then I downloaded some packages to that custom folder with yarn add --modules-folder <custom folder path>. Now When I am using this command rollup -w -i App.js -o bundle.js -p '<modules path>/#rollup/plugin-babel={presets:["<modules path>/babel-preset-solid"]}' -p '<modules path>/#rollup/plugin-node-resolve={extensions:[".js"],customResolveOptions:{moduleDirectory:"<modules path>"}}' I am getting this error (node:13672) UnhandledPromiseRejectionWarning: Error: Cannot load plugin "<modules path>/#rollup/plugin-babel": Cannot find module '<modules path>/#rollup/plugin-babel' But I am pretty sure that all packages are in custom moduels folder path. But strangely when do same process and download packages to custom location with node_modules folder in it, It works fine. So what is the problem? What am I missing here?
I am using Windows 10. Follwoing are the two scenarios where I faced problems. I created applications using create-react-app command. I installed create-react-app using command npm i -g create-react-app#1.5.2
Scenario 1
I stopped react server which was running using npm start command. Then I installed bootstrap using npm i bootstarp#4.1.1 and then I tried to run command npm start but rathern than starting the server, it has given an error 'react-scripts' is not recognized as an internal or external command.
The application is working perfactly before I stopped the react server and installed bootstrap.
Steps to recreate the problem:
create-react-app demo
cd demo
npm start (loaded the application in browser with home page)
stopped the server using Ctrl + C (break)
npm i bootstrap#4.1.1
npm start (giving error 'react-scripts' is not recognized as an internal or external command)
Scenario 2
I installed bootstrap in running react server using another command window / visul studio command line using npm i bootstarp#4.1.1 and when I imported bootstrap file in index.js and saved the file. It have given error
./node_modules/style-loader/lib/addStyles.js
Module build failed: Error: ENOENT: no such file or directory, open 'D:\react\demo2\node_modules\style-loader\lib\addStyles.js'
Steps to recreate the problem:
create-react-app demo
cd demo2
npm start (loaded the application in browser with home page)
Open another command window and reached to location demo4 folder
npm i bootstrap#4.1.1
open index.js in src folder and write: import 'bootstrap/dist/css/bootstrap.css';
save the file and error comes.
I've found many topics about this issue:
https://github.com/facebook/create-react-app/issues/1627
https://github.com/facebook/create-react-app/issues/2436
'react-scripts' is not recognized as an internal or external command
I think that it is related to the npm version that you use. It seems that npm doesn't install all the required dependencies.
Try to run npm update in order to update the dependencies. After this, npm start should work fine:
npm update
npm start