gandjustas / windows-credman Goto Github PK
View Code? Open in Web Editor NEWNative wrapper for Windows Credential Manager
Native wrapper for Windows Credential Manager
I am trying to use this solution in webpack.
When I start it, I get an error:
`C:\ListForms>webpack
C:\ListForms\node_modules\webpack-cli\bin\cli.js:93
throw err;
^
Error: The module '\?\C:\ListForms\node_modules\windows-credman\lib\windows-credman-x64.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (C:\ListForms\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object. (C:\ListForms\node_modules\windows-credman\index.js:1:80)
at Module._compile (C:\ListForms\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (C:\ListForms\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object. (C:\ListForms\webpack.config.ts:8:17)
at Module._compile (C:\ListForms\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (C:\ListForms\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (C:\ListForms\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\ListForms\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\ListForms\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach ()
at module.exports (C:\ListForms\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at yargs.parse (C:\ListForms\node_modules\webpack-cli\bin\cli.js:71:45)
at Object.parse (C:\ListForms\node_modules\yargs\yargs.js:567:18)
at C:\ListForms\node_modules\webpack-cli\bin\cli.js:49:8
at Object. (C:\ListForms\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (C:\ListForms\node_modules\webpack\bin\webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
`
Versions:
I tried to manually delete the windows-credman folder in node_modules. Then I ran npm install.
Then: npm rebuild windows-credman --update-binary
Did not help :(
For some environments we get this error message:
Unhandled rejection Error: Module version mismatch. Expected 48, got 51.
I suspect this is due to an incompatibility with the node version.
What version of node is required to use this module?
I publish application using SPSaveWebpackPlugin to Microsoft SharePoint Server. Now itβs just a json file of this format:
{ "username":"login", "password":"paddword", "domain":"DOMAIN" }
I want to keep the connection account protected.
Here is my configuration file:
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const path = require('path');
const SPSaveWebpackPlugin = require('spsave-webpack-plugin');
//const c = require("./settings.json");
const webpack = require('webpack');
const CompressionPlugin = require('compression-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const credman = require('windows-credman');
module.exports = {
stats: "normal",
mode: 'development', //development, production
entry: {
responsiblePersonsViewForm: path.join(__dirname, 'src', 'Forms', 'ResponsiblePersons', 'ResponsiblePersonsViewForm.tsx'),
responsiblePersonsEditForm: path.join(__dirname, 'src', 'Forms', 'ResponsiblePersons', 'ResponsiblePersonsEditForm.tsx'),
},
watch: true,
output: {
path: path.join(__dirname, 'build'),
publicPath: '/dist/',
filename: "[name].bundle.js",
chunkFilename: '[name].js',
libraryTarget: "umd",
library: 'PortalListForms',
pathinfo: true
},
plugins: [
new webpack.IgnorePlugin(/^./locale$/, /moment$/),
new CompressionPlugin(),
new BundleAnalyzerPlugin(),
new SPSaveWebpackPlugin({
"coreOptions": {
"checkin": true,
"checkinType": 1,
"siteUrl": "https://sharepointportal/"
},
//"credentialOptions": c,
"credentialOptions": credman.getCredentials('paccount'),
"fileOptions": {
"folder": "SiteAssets/ListForms"
}
})
],
optimization: {
//minimizer: [new UglifyJsPlugin()],
},
module: {
rules: [
{
test: /.less$/,
exclude: //node_modules//,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader', // translates CSS into CommonJS
}, {
loader: 'less-loader', // compiles Less to CSS
options:
{
modifyVars: {
'primary-color': '#00a88e',
'border-color': '#00a88e !important',
'link-color': '#00a88e',
'border-radius-base': '2px'
// or
//'hack': true; @import "your-less-file-path.less";
, // Override with less file
},
javascriptEnabled: true,
},
}]
},
{
test: /.css$/,
exclude: //node_modules//,
loader: ['style-loader', 'css-loader']
},
{
test: /.(ts|tsx)$/,
loader: "awesome-typescript-loader",
exclude: //node_modules//,
},
{
test: /.jsx?$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'src', 'Components')
],
exclude: [
path.resolve(__dirname, 'node_modules')
],
loader: 'babel-loader',
query: {
presets: [
["@babel/env", {
"targets": {
"browsers": "last 2 chrome versions"
}
}]
]
}
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.json', '.js', '.jsx'],
modules: [
path.resolve(__dirname, "node_modules")
]
},
devtool: 'source-map',
devServer: {
contentBase: path.join('/dist/'),
inline: true,
host: '0.0.0.0',
port: 8080,
}
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.